-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide actual filename of downloaded files rather than e.g. download.jpg #3797
Comments
I've seen this too. For PDF, if you click the link on the name of the pdf, you'll see that the correct name appears on saving. But if you click the thumbnail, then the name is incorrect. For images it seems both cases fail to provide the correct name for download. This can probably be fixed. I'm requalifying this issue as a bug report rather. |
Ok I figured out the bug. The Content-Disposition header was only set when forceDownload was set (on pdf for instance), because it was needed to force the download. Now I also set it for other files that can be displayed in the browser but with |
Cool, thanks a lot! Looking forward to hypernext :) |
* hypernext: add users to apiv2 doc add query parameters in api doc for experiments and items GET add apidocv2 yarn command remove dead code, check is handled in readAll fix issue with incorrect semantic version compare fix event deletion notification preferences not honored fix filename download with non ascii characters correctly use the image name on download.php. fix #3797 add more columns to csv scheduler export add bound entity title to event output and ui make full syntax link on search page appear like a link improve ui for ucp change pass
Hi! Thanks for implementing and constantly improving the app! It took a while for me to get back to this. The issue is resolved when opening an image from the attachments section and then right-click 'save image as...' in Firefox. However, what I tend to do (which seems more natural to me) is to drag and drop images from the body of the displayed experiment to a folder on the mac or use the 'save as' method. Doing this now results in We're still on 4.5.13, but judging from the changelog, it doesn't look like there was a recent change that would have changed this for 4.6.x. |
I am not sure how the browser can pickup the filename on a drag out action or right click save as. Do you have an example web app that does that to provide? |
I tracked it down to a difference in how the In my quick tests, simply appending So in summary, it may be as simple as adding the proper |
Done! |
Sorry, it took a while for me to update to recent versions. The following was tested with 4.8.3. I've tested and the solution does work for images inserted via the attachments section below the editor and then selecting 'insert in text at cursor position'. However, if you drag&drop an image from the filesystem directly into the editor (not into the drag&drop area), the 'name' attribute is not set in the html and the file shows as 'unnamed_file'. Further, if you use the 'edit filename' function in the attachments section, the name param in the body are not updated accordingly and thus downloaded filenames for files taken from the text body will be wrong and remain as they were at insert-time. So it seems like the solution is a bit more tricky and must involve updating img src attributes when anything changes. Thanks a lot for the continuous updates! |
Feature request
Hi!
In our pipeline, we take care to name images uploaded to elabFTW in a meaningful way. The reverse process, e.g. downloading an image by dragging&dropping them from elabFTW into a local folder or through "save image as", will create files named like download.jpg. Likewise, clicking "save link as" on an attached PDF suggests to save the file as "download.pdf".
The behavior is reported for elabFTW 4.3.10, tested on Chromium 98.0.4694.0 and Firefox 104.0.1.
It would be quite convenient for consistency to have a straightforward way of downloading images with their originally stored name.
Thanks!
I'm using the hosted version or I have PRO support: NO
The text was updated successfully, but these errors were encountered: