> I am 
> wondering if this is my headers that are doing this, but I 
> really dont know.

I think its an IE or Windows behavior and what causes it is the multiple
dots in the filename. I resorted to naming our downloads
"filename-v1_0_2_1.exe"

> -----Original Message-----
> From: Aaron Todd [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 27, 2004 11:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Download Script
> 
> 
> I've created a download script that works quite nicely.  The 
> only issue with 
> it is that when I download a file where the file name is like 
> "filename 
> v1.0.2.1.exe" there is some extra characters added into the 
> name when it is 
> downloaded.  So that file will be "filename v1[1].0.2.1.exe".  I am 
> wondering if this is my headers that are doing this, but I 
> really dont know.
> 
> Here is my code:
> <?php
> $file = $_GET['file'];
> $path = $_GET['type'];
> $rootpath = "/home/virtual/site341/fst/var/www/downloads/";
> $filename = "$rootpath$path/$file";
> if (file_exists($filename)) {
>   header("Content-Description: File Transfer");
>   header("Pragma: no-cache");
>   header("Content-Type: application/force-download");
>   header("Content-Disposition: attachment; 
> filename=".basename($filename));
>   header("Content-Length: ".filesize($filename));
>   $handle = fopen(($filename), "r");
>   print(fread($handle, filesize($filename)));
>   flush();
>   fclose($handle);
> } else {
>   header("HTTP/1.0 404 Not Found");
> }
> ?>
> If anyone can let me know what is going on I'd appreciate it.
> 
> Thanks,
> 
> Aaron 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Reply via email to