Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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 ( #993554=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^2: How do I Select an uploaded file in cgi to further process?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-07-03 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls