file download?
am 25.11.2007 06:44:23 von grande news
Hello, this might be a newbie question. I am uploading files to my http
script, using $_FILES . That's how I get binary data into my script. How
do I return it? Echo only returns text data, right? Is there any way to
pass binary data back from a script?
Thanks
B
Re: file download?
am 25.11.2007 07:58:54 von Jerry Stuckle
Bint wrote:
> Hello, this might be a newbie question. I am uploading files to my http
> script, using $_FILES . That's how I get binary data into my script. How
> do I return it? Echo only returns text data, right? Is there any way to
> pass binary data back from a script?
>
> Thanks
> B
>
>
>
Put the data into a file and download the file.
Echo will return anything you tell it. But most browsers will get quite
upset if you send characters not in the specified charset.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: file download?
am 26.11.2007 04:13:00 von Kailash Nadh
If you do a plain echo, the spew out the binary content as junk
characters.
Try a header() before echoing the data.
Something like
header("Content-type: application/octet-stream");
or whatever type of binary content it is.
Re: file download?
am 26.11.2007 04:47:26 von Kailash Nadh
* the script spews out..
Sorry for the type.
Regards,
Kailash Nadh
http://kailashnadh.name
Re: file download?
am 26.11.2007 07:03:30 von taps128
Bint wrote:
> Hello, this might be a newbie question. I am uploading files to my http
> script, using $_FILES . That's how I get binary data into my script. How
> do I return it? Echo only returns text data, right? Is there any way to
> pass binary data back from a script?
>
> Thanks
> B
>
>
header('Content-Disposition: attachment;filename=zipfile.zip');
echo $zipfile;