bug Laravel response download file incorrectly returned as file.txt instead its intended filename (only on artisan serve) #49032
Unanswered
krucilatoz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem description :
I was migrating my app to Laravel 9, but then I notice when I download file it was returned as "file.txt", not the intended filename. The correct file name should be .pdf / .zip / .jpg depending on which app-module / page.
If I rename the "file.txt" to its expected filename (eg: somefile.zip) then I can open the file correctly.
This only happen when run app in development (using php artisan serve). Running the app in the Apache webserver doesn't produce this error. Therefore I can ignore this on my production server since it running on apache anyway.
Some snippet on how the file downloaded :
Additional info :
I also ask this in stackoverflow on this link
Beta Was this translation helpful? Give feedback.
All reactions