Jonathan Werre wrote:
> I'm trying to moniter the status of a file upload using the CGI::upload subroutine.
>The file uploads work great, and the users are very satisfied, but the file sizes are
>commonly over 100 megabytes and they want to be able to monitor the status showing
>output approximately every 5 seconds as a percentage of bytes written/total filesize.
> I want to continue using CGI::upload, because its been working quite well, and I
>plan on using Randal Schwartz's magical two-pronged CGI technique for displaying
>results as explained in his web techniques column
>http://www.stonehenge.com/merlyn/WebTechniques/col20.html .
> My problem is getting the name of the temp file CGI::upload creates so that I can
>monitor the number of bytes as they are written and I don't want to modify CGI.pm for
>portability reasons if possible I'm using ver 2.74. Here are the variables and code
>where I think the temp filename is created
> # choose a relatively unpredictable tmpfile sequence number
> my $seqno = unpack("%16C*",join('',localtime,values %ENV));
> for (my $cnt=10;$cnt>0;$cnt--) {
> next unless $tmpfile = new TempFile($seqno);
> $tmp = $tmpfile->as_string;
> last if defined($filehandle = Fh->new($filename,$tmp,$PRIVATE_TEMPFILES));
> $seqno += int rand(100);
> }
> die "CGI open of tmpfile: $!\n" unless $filehandle;
>
> Anyone know how I can scope into CGI.pm to get the string value of that
>filename????? I think its going to be
>
> $TempFile::TMPDIRECTORY/[something] .
For a normal CGI object called $cgi that parsed the form data:
my $tmp_file_name = $cgi->tmpFileName($formname_value_for_filename_field);
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs