Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: why do CGI's mess everything up???

by earthboundmisfit (Chaplain)
on Dec 12, 2002 at 15:28 UTC ( [id://219340]=note: print w/replies, xml ) Need Help??


in reply to why do CGI's mess everything up???

Just a guess, but are you using this script on a Windows box? Some browsers insert "\r" as the newline for uploaded data and this subsequently messes up homegrown parsing routines. The way I've gotten around this is to filter for "\r" when saving the data. Here's a sub from a script I'm working on. I'm still working out the taint checking and have a ways to go, but perhaps this will help you out despite still being in its infancy:
sub write_file() { my $filehandle = shift; my $type = uploadInfo($filehandle)->{'Content-Type'}; die "text files only at this point" unless ($type eq 'text/plain' or +$type eq 'text/html'); print "file: $filehandle of type $type\n\n <PRE>"; open (FH, ">d:/inetpub/wwwroot/repnet/docs/$filehandle") or die "cannot create file: $!"; while (<$filehandle>) { $_ =~ s/\r//g; print; print FH; } print "</PRE>"; close(FH); }
---- I am what I read

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219340]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-28 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found