Scott Phelps wrote:
> 
> I'm trying to set up a upload download system that stores it's files off
> web. Here's a snippet from how I'm passing the off web file to the browser
> now.
> 
> open (FILE,"$file") ;
> binmode FILE;
> $size= -s FILE;
> print "Content: $filenm\r\n";
> print "Content-Type: application/octet-stream\r\n";
> print "Content-Length: $size\n";
> print "Content-Disposition: attachment\; filename=$filenm\r\n\r\n";
> 
> while(<BFILE>){
>         print $_;
> }
> 
> It tends to corrupt a variety of files though, is there a different way I
> should set binmode? I believe this code is tested, as I found it lying
> around somewhere, and it may work great from a *nix platform.
> 
> Acrobat for example complains about the wonderful little rectangular box
> character in PDF files (I'm too lazy to figure out how to type it!).

You need to binmode STDOUT also before the while.

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.todbe.com/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to