I currently store my woocommerce product files on S3 in the following format:
/bucket/{product_id}.zip
When a customer clicks the download link in their customer dashboard the element is as follows:
<a href="https://url/1234.zip">Download Product Name</a>
This downloads the file into their downloads folder as 1234.zip
I would like to be able to pass some values to the request so that the filename can be downloaded as {param1}-{param2}.zip
2
Answers
Like this:
Refer: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
Note:
When they click a button to download the file, you can add the HTML5 attribute "download" where you can set the default filename.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
<a href="https://url/1234.zip" download={
${param1}-${param2}.zip
}>Download Product Name