Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Upload files with Web Application Server 3.0

Re: Upload files with Web Application Server 3.0

From: Axel Nagel <nagel_at_mpimg-berlin-dahlem.mpg.de>
Date: 1998/09/16
Message-ID: <35FFD116.211F6761@mpimg-berlin-dahlem.mpg.de>#1/1

hello

I encountered the same problem and used a perl script. I didn't want to compile the OWAR as metioned in an earlier reply. So I used the perl cgi, which parses the file and redirects it output to a plsql procedure, which displays the the data in the file, which can be submitted via plsql in the database.

Dont send to long or to much name=value pairs. I encoutered bugs which caused the webagent to die. This problem has been reported several times on this newsgroup.

p.s.: I'am working on Digital with OWAS 3.x and Oracle 8.x

#!/usr/local/bin/perl
# CGI Script: object-form.pl

use CGI;

$query = new CGI;

&parse($query);

sub parse {
#change to your URL for relocation #

    print
"Location:http://jonny:4711/plsqlagentgaga/plsql/packagexyz.file_upload?";

    local($query) = @_;
    local(@values,$key);
$filename = $query->param('dgt_file_in');
    ($experiment,$filter) = $filename =~ /([A-Za-z]{1,5}[\-]{0,1}[0-9]{1,5})-([0-9A-Z\-]{1,20}).dgt$/;

    # outputs data as CGI name value pairs -> input paramter for plsql

    print"filter_in=$filter";
    print"&experiment_in=$experiment";
    print"&filename_in=$filename";

    # Read a text file and send to
$notation='';
$data='';

    # my special parsing routine which sends the different elemnts as fixed lenght to overcome owa bugs when sending lots of data

    while (<$filename>) {

	if (substr($_,0,1)=="#") {
	    # send comments
	    $comment = $_;
	    $comment =~ tr/' #'/'++'/;
	    chop($comment);
	    $notation=$notation.$comment;
	}
        else{
	    @array = split(' ',$_);
	    # send coordinates in format x 3 stellen, y 3 stellen, clone 6
stellen, score 1 stelle next value 
            $data=$data.sprintf("%3s",substr(@array[0],0));
	    $data=$data.sprintf("%3s",substr(@array[1],0));
	    $data=$data.sprintf("%6s",substr(@array[2],0));
	    $data=$data.sprintf("%1s",substr(@array[3],0));
	}

    }
$data=~ tr/' '/'+'/;

    print "&comment_in=".$notation.'&data_in='.$data; # sends the files contents as name value pairs

    print"\n\n"; # essential to send redirect }  

-- 
*************************************************
*  Dipl.-Ing. Axel Nagel                        *
*  Max-Planck-Institut fuer Molekulare Genetik  *
*  Abteilung Lehrach                            *
*  Ihnestrasse 73                               *
*  D-14195 Berlin                               *
*                                               *
*  Tel.: +49 (0)30 8413-1353                    *
*  email: nagel_at_mpimg-berlin-dahlem.mpg.de      *
*************************************************
Received on Wed Sep 16 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US