perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ckas...@eplsite.org>
Subject Re: Upload file
Date Thu, 09 Oct 2003 00:08:19 GMT
Hi:

In EplSite WorkFlow i am using this routine and works fine:

    use CGI;
    $query = new CGI;

    if( $file = $query->param('ImageName') )
    {
       @thefile = split(/\\/,$file);
       $elements = @thefile;
       $thedocument = "$$-@thefile[$elements-1]";
       $thedocument =~ s/\s/_/g;
       if( open (OUTFILE,">$globalp->{Documents_path}/$thedocument") )
       {
          binmode(OUTFILE);# Explicit binary mode
          while ($bytesread=read($fdat{attachthis},$buffer,32768))
           {
             print OUTFILE $buffer;
           }
          close(OUTFILE);
       }
    }

I am using CGI for some manipulation on filename but you could not use it.

I hope this helps

Carlos Kassab


> Hi, I have this script.
>
> <FORM METHOD="POST" ENCTYPE="multipart/form-data">
>  <input TYPE="FILE" NAME="ImageName" >
> </FORM>
>
> [-
>
> if (defined $fdat{ImageName}) {
>     open FILE, "> test ;
>     print FILE $buffer
>     while read($fdat{ImageName}, $buffer, 32768);
>     close FILE;
> }
>
> -]
>
> File test exist but have size 0 k.
> I have Embperl v 1.3.6.
>
> Thanks, Rado
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message