datannen has asked for the wisdom of the Perl Monks concerning the following question:
I want to store the data stream as it uploads to: /tmp/1154632892005/postdata<FORM action="/cgi-bin/test.cgi" method="post" enctype="multipart/form +-data"> <input value="1154632892005" name="unique" type="hidden"> <INPUT TYPE="FILE" NAME="file"> <INPUT type="submit" value="Send"> <INPUT type="reset"> </FORM>
However, I wind up with nothing in postdata. This same process works if I do not use enctype="multipart/form-data" Help?use CGI; use Fcntl qw(:DEFAULT :flock); my $cgi = new CGI; $user_dir = "/tmp/1154632892005"; open(TMP,">","$user_dir/postdata") or &bye_bye ("can't open temp file" +); my $i=0; $ofh = select(TMP); $| = 1; select ($ofh); while (read (STDIN ,$LINE, 4096) && $bRead < $len ) { $bRead += length $LINE; $size = -s "$user_dir/postdata"; select(undef, undef, undef,0.35); # sleep for 0.2 of a s +econd. $i++; print TMP $LINE; } close (TMP);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multipart/form-data files
by chromatic (Archbishop) on Aug 07, 2006 at 23:25 UTC | |
|
Re: multipart/form-data files
by kwaping (Priest) on Aug 07, 2006 at 23:19 UTC | |
|
Re: multipart/form-data files
by gellyfish (Monsignor) on Aug 08, 2006 at 07:39 UTC | |
|
Re: multipart/form-data files
by Anonymous Monk on Aug 11, 2006 at 10:57 UTC |