This seems like it should be so very easy. I have never had the need to use a download button before. I am now trying to set one up, but it always tries to open the file instead. Any one have a short and simple code that could be used in the 'onclick' of a button to download a file, without trying to open it?
This opens a file very nicely, now if only it could be rewritten to perform a download...
To retrieve a file, after we have notified you it is ready for retrieval, enter in the box below the same name you entered to upload the
file. (Such as 'companyname.qbb') Then click the 'Download' button and select 'Save'.
<form name=form1>
<input type=text name="datafile" size="50"><br>
<input type=button onClick="location.href='/files/' + document.form1.datafile.value;" value="Download">
</form>
If the file format (file extension) is not recognized by your operating system, it works as I wish. If the file is one that is recognized, .txt, .doc etc. it opens.
This opens a file very nicely, now if only it could be rewritten to perform a download...
To retrieve a file, after we have notified you it is ready for retrieval, enter in the box below the same name you entered to upload the
file. (Such as 'companyname.qbb') Then click the 'Download' button and select 'Save'.
<form name=form1>
<input type=text name="datafile" size="50"><br>
<input type=button onClick="location.href='/files/' + document.form1.datafile.value;" value="Download">
</form>
If the file format (file extension) is not recognized by your operating system, it works as I wish. If the file is one that is recognized, .txt, .doc etc. it opens.
Comment