Closed dpatte closed 9 years ago
Hi, thanks for your question.
If the filename you would like to use is the same as the filename
stored for the file in the collection, then you shouldn't need to specify the filename at all in the HTML, as that is the default case. This is documented in the "HTTP request behaviors" section of the README.
So, your HTML should look like:
<a href="{{path}}?download=true"> ... </a>
Note that the "download" part is actually an URL query, not a separate attrib on the anchor tag as you show in the OP. It all goes in the href
attrib. If you want to change the filename from what is stored for the file (or if there is no filename in the collection):
<a href="{{path}}?download=true&filename={{filename}}"> ... </a>
Hope this helps.
If you look here in the sample app, you can see how it works there:
https://github.com/vsivsi/meteor-file-sample-app/blob/master/sample.html#L42
Thanks you. Works great. Your quick response is appreciated. Very useful package!
Great, happy to help.
What would the html link look like, or process be, to download a file from a file collection, restoring its original name?
I have tried a href="{{path}}" download="{{filename}}" {{filename}} /a but it is named according to its fileid, not its filename.