graham23s Posted May 31, 2007 Share Posted May 31, 2007 Hi Guys, i was wondering if this was possible, when a user wants to download a file from my server say: filename.pdf they need to "right click" save as to get it, but i was wondering if there was a way i could have a regular submit button do it for example: <input type="submit" name="submit" value="Download File" /> once it's clicked it pops up the download box thanks for any help guys Graham Quote Link to comment https://forums.phpfreaks.com/topic/53718-click-a-button-to-download-a-file/ Share on other sites More sharing options...
Orio Posted May 31, 2007 Share Posted May 31, 2007 Something like this? <form method="POST" action="filename.pdf"> <input type="submit" value="Download!"> </form> Orio. Quote Link to comment https://forums.phpfreaks.com/topic/53718-click-a-button-to-download-a-file/#findComment-265469 Share on other sites More sharing options...
graham23s Posted May 31, 2007 Author Share Posted May 31, 2007 Hi Mate, yep that looks good, only the id will be dynamic kinda like: download_file.php?id=5 would i do something like: <form method="POST" action="download_file.php?id=$id"> <input type="submit" value="Download!"> </form> would that be right? cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/53718-click-a-button-to-download-a-file/#findComment-265704 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.