Attachment filename not set on download

AI-generated summary

In a support thread regarding attachment filenames not being set on download, iamphi reported that files uploaded on a non-Docker AWS instance (v1.8.0.beta5) lacked original filenames and that text files opened inline instead of downloading. The user noted Sidekiq was not running due to Redis connection errors and observed download links incorrectly pointing to localhost:3000. zogstrip advised fixing the Sidekiq issue immediately. iamphi clarified that Sidekiq was stopped due to Redis errors and expressed concern that truncating database tables might be the cause, asking if a fresh server install was necessary. zogstrip criticized the non-standard setup and strongly recommended starting over using the official Docker installation guide. Ultimately, iamphi confirmed that a fresh Docker setup resolved the issue, with files downloading correctly with original names, and decided to abandon the non-Docker development setup for now.

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.

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.

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 Development if I need to go down this path.

Thanks.