sending headers via apache request content_type method, which seems to prevent the...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 4 Sep 2008 13:01:50 +0000 (13:01 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 4 Sep 2008 13:01:50 +0000 (13:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10532 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/Vandelay.pm

index 1e80ca6..2014e70 100644 (file)
@@ -56,25 +56,26 @@ sub spool_marc {
 
        return Apache2::Const::FORBIDDEN unless verify_login($auth);
 
-
+    my $data_fingerprint = '';
        my $purpose = $cgi->param('purpose');
        my $file = $cgi->param('marc_upload');
-       my $filename = "$file";
-
-       my $data = join '', (<$file>);
-       $data = encode_base64($data);
-
-       my $data_fingerprint = md5_hex($data);
-
-       OpenSRF::Utils::Cache->new->put_cache(
-               'vandelay_import_spool_' . $data_fingerprint,
-               { purpose => $purpose, marc => $data }
-       );
-
-       print "Content-type: text/plain; charset=utf-8\n\n$data_fingerprint";
 
+    if($file and -e $file) {
+
+           my $data = join '', (<$file>);
+           $data = encode_base64($data);
+    
+           $data_fingerprint = md5_hex($data);
+    
+           OpenSRF::Utils::Cache->new->put_cache(
+                   'vandelay_import_spool_' . $data_fingerprint,
+                   { purpose => $purpose, marc => $data }
+           );
+    }
+
+    $r->content_type('text/plain; charset=utf-8');
+       print "$data_fingerprint";
        return Apache2::Const::OK;
-
 }
 
 sub verify_login {