Attachment filename not set on download

Hello
I authorized my own extension, made a new post and uploaded a test file of my extension and the download does not have the original filename.
I also attached an txt file and that doesn’t download, but it opens in the same screen.

My current version is v1.8.0.beta5 +99. sidekiq is not running.

My test discourse server is hosted on AWS and following these guides:


I have read various posts about attachments are saved on disk/s3 with the filehash as the filename. However, I noticed that the discourse.txt download from the first post here:
https://meta.discourse.org/t/new-attachments/8609

has this header on download:Content-Disposition:"attachment; filename="discourse.txt"

Is that the side effect of using S3 as file storage? Can that header be added for disk base file storage?

Thank you.

Why is sidekiq not running? You should fix that first.

2 Likes

I stopped running sidekiq because I kept seeing error messages about failing to connect to redis. I deleted the three redis queue and now sidekiq seems to be ok. I see passing jobs in sidekiq/statistic/realtime. My instance is an m4.large.

Now inline pictures and attachment download links are using localhost:3000 as the domain, instead of ec2’s public dns name. I’ve tried setting the company domain name, but it did not help.
I had truncated the posts and topics tables many times, does this contribute to my download problems? Maybe I should start with a new, fresh server?

Wow what have you done to your poor Discourse?

Did you install it using our recommended Docker install? If not, you should start over and follow it.

1 Like

I made a docker setup and everything is working as expected. Files are downloaded with the original file name.
I also made another development setup (not docker) and I think sideqik was turning my attachment urls to use localhost; I’ll take this up in #dev if I need to go down this path.

Thanks.

3 Likes