Jump to content

Create a download file link


fredted40x
 Share

Recommended Posts

Hi,

 

Just looking how to create a link to download a file located on the server, it will be files like .doc etc.

 

Cant seem to find anything on the net so i think i need php but may be html.

 

Can anyone point me in the right direction?

 

Thanks

 

p.s. it will be used for more than one file so im looking for a small ish amount of code.

Link to comment
Share on other sites

you can use <a > tag but if you are trying to do with .txt file then it's open in browser only not give a popup to download. Please visit below link and code to implement download file.

 

http://php.net/manual/en/function.header.php

 

 

<?php// We'll be outputting a PDFheader('Content-type: application/pdf');// It will be called downloaded.pdfheader('Content-Disposition: attachment; filename="downloaded.pdf"');// The PDF source is in original.pdfreadfile('original.pdf');?>

 

Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

×
×
  • 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.