Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Problems with users downloading files from forum post
epipen
New
Please view this screencast as an example
removed at user's request
when a user tries to download a file, the file name instead of say "test.docx" downloads with a file name such as "ajele2424jlklskdj4.docx" and for some users this file has showed up as incomprehensible streams of text characters as if it is encoded.
Any idea how to fix this? All users have access to download attached files.
Tagged:
0
Comments
On upload, the original filename is stored in the db. The file on disk is given a unique name to avoid collisions.
The other issue can be sidestepped by right clicking on the file link and selecting save as. I am pretty sure this is caused by a browser (mis)configuration. Can you verify the file downloads correctly via the context menu (right click)?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
when you right click and save as the file comes up as a .htm, This is all good and fine for me, but confusing for our users.
The settings of IE are default and have been reset to default in the tools/advanced settings and what not. I would tend to rule out misconfiguration for that reason.
No issue with doc,pdf,zip. For now I have zipped the file
Is there any way to disable the "unique name" setting?
when you use chrome, the download starts automatically with only the unique name issue.
I think you would have to overwrite the cores
class.upload.php
Filename must be sanitized (length and characters) and afterwards you would have to check for duplicate filenames and add something like a counter to duplicates.
That should work, but I wouldn't do that if I were you.
Well, it seems to have saved the original file name in the DB, because when you mouse over an uploaded file it shows the original file name. Is there some way to have the file be offered with the original file name when a download is requested.
(that is to say i understand the reason for having a unique file name stored in the database but am trying to work around it still).
I would look into modifying the file name before sending it back to the user. You would have to create a new function that the download link refers to. Something like
/fileupload/download/{MEDIA_ID}
. Then modify the headers and just read out the file.This is just a starting point and would require some testing. Let me know if it works at all.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.