On Feb 6, 2008 2:29 AM, Aniesh joseph <[EMAIL PROTECTED]> wrote:
> I tried stat() function but it doesn't return the result. Anyway I got a
> function to calculate the size of the remote file and it works fine. The
> page link is below:
>
> http://textsnippets.com/posts/show/1214

I am impressed you wrote that, but you should use curl instead.  Just
set it to follow redirects and only download the headers.  There is no
reason to write a partial implementation of HTTP using
streams/sockets.

> But now some other issue at the time of audio download. I use the following
> headers in  the download page:
>
>
>  $mm_type="application/octet-stream";
>
>  header("Cache-Control: public, must-revalidate");
>  header("Pragma: hack");
>  header("Content-Type: " . $mm_type);
>  header("Content-Length: " .(string)(filesize($myFile)) );
>  header('Content-Disposition: attachment; filename="'.$filename.'"');
>  header("Content-Transfer-Encoding: binary\n");
>
>  readfile($myFile);

I don't think you need Content-Disposition or
Content-Transfer-Encoding headers since you are only sending one file
per request.  I am not sure why you have a cache-control header
either.

John C.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to