#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    Hi,

    I am creating an intranet-type file management system where two or three users can upload and download Word files.

    I know how to allow for file upload using HTML forms, but is there a way to allow download??

    I'd appreciate if someone could help me out -- I can't seem to find any sample code to help me out.

    Thanks,
    Sonya

  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    Basic downloading is accomplished by just linking to the file. As long as the extension isn't one that would normally open in a browser (e.g. .gif, .jpg). That said, .doc files will download normally under netscape and earlier version of IE. Later version of IE will open .doc types in the browser. That makes things a bit more complicated. You'll have to send headers setting the name of the file and the content-type (application/octet-stream) to force a download. Then read the file and pass it to the user.

    Go to www.phpbuilder.com and do a search for "download" in the support forum, this has been discussed numerous times there.

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    9
    Rep Power
    0
    Hi rod k,
    I have a <a href><?php .... ?></a> in a php file. what this php code does is read a file(.exe) and send it over to the client. I am having problem downloading the file when i click on this link. It just send me text dump on my browser. I try to use the header(...), but it complains that header could not be sent again. How can i send the header over to the client again? I have to create the download link this way in order to hide the actual path of the file from the client. Do u have a better suggestion? Thanx in advance!


Similar Threads

  1. Replies: 3
    Last Post: February 17th, 2004, 10:08 AM
  2. How to write a PHP script to remove a file?
    By xmxpcom in forum PHP Development
    Replies: 2
    Last Post: February 16th, 2004, 05:58 PM
  3. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM
  4. Cron Job output to system output or a file
    By sathi in forum UNIX Help
    Replies: 3
    Last Post: February 4th, 2004, 08:25 AM
  5. Simple find and replace word search for a text file with php?
    By rabid lemming in forum PHP Development
    Replies: 4
    Last Post: February 1st, 2004, 09:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo