Web Analytics Made Easy -
StatCounter Download A file - CodingForum

Announcement

Collapse
No announcement yet.

Download A file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Download A file

    If I want my users to download a .zip or .exe file the command is

    <a href=filename.exe>Download</a>
    or
    <a href=filename.zip>Download</a>

    This will ask the visitors where to save the file on their hard disk.

    But what if I want my users to download a doc/pdf/php/html file and I dnt want the browser to display these on the the browser itself but ask the users to save them.

    <a href=filename.php>Download</a> will simple display the page on the browser.


    PS: I dont wanna compress them.

    Any help appreciated

  • #2
    header

    Comment


    • #3
      to be precise
      PHP Code:
      <?php 
      header
      ("Content-Type: application/force-download");
      ?>

      Comment

      Working...
      X