My iframe tag look like bellow
<iframe width="100%" height="100%" src="'+file_url+'" frameBorder="0"> <p>Your browser does not support .</p></iframe>
file_url = store/ASDFVASDFADSFACASDFCDDF.doc
file_name = my word.doc
when i click on the iframe open link file download with incorrect file name.(doc file download with ASDFVASDFADSFACASDFCDDF.doc file name). how can i download file with real file name using iframe?
The iframe
element can't do that, but you could put this in a .htaccess
file in the 'store' directory :
<FilesMatch ".doc$">
Header set Content-Disposition "attachment; filename=myword.doc"
</FilesMatch>
Note that I'm assuming Apache here, but most webservers have a similar function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With