Results 1 to 4 of 4

Thread: Can PHP return a file?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    29

    Red face Can PHP return a file?

    Hi guys,

    If my user's browser submits a form with certain parameters that are used to perform a searching in my database. After searching, is it possible to use PHP to return a file for example car.gif to the user's browser. I meant just the car.gif without any using HTML or XHTML or PHP.

    Your help is very much appreciated. Thank you

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Can PHP return a file?

    You need to use the header() function to change the content tpye of the page.


    Take a look at it goes into detail about creating downloads,
    http://www.vbforums.com/showthread.p...=File+Download

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    29

    Re: Can PHP return a file?

    Hi John,

    Thank again. Header really solves my problem. Do you have a complete list of headers with their explanations?

  4. #4
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Can PHP return a file?

    Take a look at these for more header information

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
    http://www.cs.tut.fi/~jkorpela/http.html

    Hope they help you out some more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width