As I said check out www.w3.org, and the HTTP documentation for this. I think
you can send content-type unknown, or binary or something. But I wont look
it up for you. ;) There should though be a generic format so send binary
data with.

And of course if you uses a script, nothing prevent you from varying the
content type to fit/match the type of file you intend to send to the client
side.

        /Anders

>-----Original Message-----
>From: Sandeep Murphy [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, February 21, 2002 8:15 PM
>To: 'Olivier Hubert'; Sandeep Murphy; [EMAIL PROTECTED]
>Subject: RE: [PHP-WIN] local drive
>
>
>hi..
> 
>thnx a bunch... yet to try it out ..but hv 1 more question... 
>the contenttype is gonna vary...PDF/image/excel file etc..
> 
>I can send the the content type dyanmically right?? as i hv a 
>field in my db with content types..
> 
>thnx...
> 
>sands
>
>-----Original Message-----
>From: Olivier Hubert [mailto:[EMAIL PROTECTED]]
>Sent: quinta-feira, 21 de Fevereiro de 2002 18:48
>To: Sandeep Murphy; [EMAIL PROTECTED]
>Subject: RE: [PHP-WIN] local drive
>
>
>Ok,
>
>        I'll assume the file that you want to send is an image 
>and that the
>image is in a variable named $Image. As Svensson mentionned, 
>you need to
>send out the headers first:
>
>header ("Content-Disposition: attachment; filename=Fubar.txt");
>header ("Content-Type: image/jpeg");
>
>if you have the size of the image/file, you can always send it with the
>Content-Length header (e.g. header ("Content-Length: 12345");)
>
>After sending the headers you simply send the data with an echo:
>
>echo $Image;
>
>and you're done. Let's say you put all this code in a file called
>LoadImage.php; when the user calls the script (through a form 
>or link) the
>file is sent automatically.
>
>HTH
>
>Olivier
>
>At 18:12 2002-02-21 +0000, Sandeep Murphy wrote:
>
>
>
>please, wud be grateful..:)
>
>sands
>-----Original Message-----
>From: Olivier Hubert [ mailto:[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>
]
Sent: quinta-feira, 21 de Fevereiro de 2002 17:39
To: Sandeep Murphy; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] local drive


Hi,

         Do you know the mime type of the document? If so, you could simply 
send the file through HTTP e.g. when the user presses the button, instead 
of accessing a web he/she accesses a script that will send the information 
contained in the database field. If you like I could send you sample code 
to do this.

HTH

Olivier

At 17:21 2002-02-21 +0000, Sandeep Murphy wrote:
>hi,
>
>I have a document (BLOB type) in a database which I hv retrieved thru an
sql
>query...
>
>I need to allow the user to save this document to his local hard drive upon
>clicking a button...
>
>any ideas as to how I can achieve this???
>
>TIA,
>
>sands 

Olivier Hubert
Chef d'équipe informatique/IT Team leader
Groupe Constructo
(514) 856-6646
[EMAIL PROTECTED]
www.constructo.ca <http://www.constructo.ca/>  


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to