Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/53718-click-a-button-to-download-a-file/
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.