hi Sluggers,

Please excuse the perl question but Iam at my wits end.

I have written a CGI file_upload script that works fine with a
UNIX web browser.

When I go to use a Gates-based browser like netscape or IE, 
it uploads the file OK, but it's Zero-Length. 

I have done all the path clearing stuff to make sure just the 
correct name of the file is uploaded. 

In my upload code I make sure I do a binmode() on the filehandle
for the windoze stuff to work properly. 

My code snippet looks like

        open (SAVE, ">/path/to/save_dir/$file");
        binmode (SAVE);

        while (read ($file,$data,1024)){
        print SAVE $data;
        }
        close SAVE;
        chmod (/path/to/save_dir/$file, 0644);


Now all this works fine when I use a UNIX browser but 
fails to work with a Windoze one.  The file gets uploaded but is 
empty!

I can see the data being written to /var/tmp/CGItemp12334
and then the temp file is removed. 

Has anyone else seen this problem with upload CGI scripts 
based on CGI.pm?

Can anyone help me with a solution?  
I di see this once about 2 years ago but I do not recall 
how the problem was resolved. 

If anyone can help me, I'd be very grateful!


rachel

-- 
Rachel Polanskis                        Optus/Excite@Home
UNIX Administrator                      100 Harris Street
IT Operations                           Pyrmont, Sydney NSW
[EMAIL PROTECTED]                Ph: (+61 2) 900 51144


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to