I have a link to a file on a page, is there anyway I can make it so when a user clicks on the link ‘Save As’ dialog pop-up to save the file instead of displaying it?
@webtekieauthorJan 22.2004 — #ok, got it working partially: [code=php] <li><a href="http://127.0.0.1/tmp/po.prn" onclick="javascript:document.execCommand('SaveAs','1','http://127.0.0.1/tmp/po.prn');return false;">download</a></li> [/code]
the problem is that if I just put po.prn it saves source code of my page. If I put url as shown, the script does not execute. Does not give any errors either.
@IceMetalPunkJan 28.2004 — #Actually, no. the SaveAs command is only to save the site. Also, I have never heard of the extension ".prn". What kind of file is that? If the browser does not recognize the extension, that could be what's causing it to display in the window instead of saving.
@webtekieauthorJan 29.2004 — #I am able to save, I just pass the url where file is located and that's what's being saved. But you are correct, if I don't pass anything then page is being saved.
xxx.prn is just an extension I use for printable content.