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

Re: How do I Select an uploaded file in cgi to further process?

by Anonymous Monk
on Sep 07, 2012 at 21:02 UTC ( #992375=note: print w/ replies, xml ) Need Help??

Comment on Re: How do I Select an uploaded file in cgi to further process?
Re^2: How do I Select an uploaded file in cgi to further process?
by smeagol99 (Initiate) on Sep 13, 2012 at 18:31 UTC
    my %cookies = parse CGI::Cookie($cookie); my $sessionID = $cookies{'CGISESSID'}->value; if ($completedJobID) { my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID); my $results = $job->results(); $template->param(map { $_ => $results->{$_} } keys %{ $results }); } elsif ($fileID) { my $uploaded_file = C4::UploadedFile->fetch($sessionID, $fileID); my $fh = $uploaded_file->fh(); my $marcrecord=''; $/ = "\035"; while (<$fh>) { s/^\s+//; s/\s+$//; $marcrecord.=$_; } my $filename = $uploaded_file->name(); my $job = undef; my $staging_callback = sub { }; my $matching_callback = sub { }; if ($runinbackground) { my $job_size = () = $marcrecord =~ /\035/g; # if we're matching, job size is doubled $job_size *= 2 if ($matcher_id ne ""); $job = C4::BackgroundJob->new($sessionID, $filename, $ENV{'SCR +IPT_NAME'}, $job_size); my $jobID = $job->id();

    Actually, what I would like to do is get the file that has been uploaded, select it, and do something else to it, (ie. apply items to a marc formatted bib record), but I'm not sure what to grab, or how to grab the file that's been uploaded. thanks, in advance.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-04-17 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (441 votes), past polls