[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] FW: Uploading problem with Mac



I am forwarding this from the Win 32 list.

Any one have any ideas?

Walter


-----Original Message-----
From: perl-win32-users-admin@listserv.ActiveState.com
[mailto:perl-win32-users-admin@listserv.ActiveState.com] On Behalf Of
Eric Kristoff
Sent: Thursday, November 05, 1998 4:43 PM
To: Perl-Win32-Users Mailing List
Subject: Uploading problem with Mac


Hi all...

I've adapted a short script which uploads a file from the web and saves
it to a directory on my hard drive (WinNT Server).  The script works
fine
from any Wintel machine, but I get an error when I run it off a Mac:

"cgi-lib.pl: reached end of input while seeking boundary of multipart.
Format of CGI input is wrong."

It actually appears twice.
Since this will be for a school which uses 90% Macs, it needs to work
from both platforms.  Any thoughts?
I'm using cgi-lib.pl, v 2.17 1998/05/14 22:39:23 completely unedited.

Thanks,
_Eric
-------------------------------------------------------------------
# Copyright (c) 1996 Steven E. Brenner
# $Id: fup.cgi,v 1.2 1996/03/30 01:33:46 brenner Exp $


use strict;
require "d:/web/wwwroot/abrhs/scripts/cgi-lib.pl";

MAIN:
{
  my (%in,   # The form data
      %cgi_cfn,    # The uploaded file(s) client-provided name(s)
      %cgi_ct,     # The uploaded file(s) content-type(s).  These are
                   #   set by the user's browser and may be unreliable
      %cgi_sfn,    # The uploaded file(s) name(s) on the server (this
machine)
      $ret,        # Return value of the ReadParse call.
      $buf,        # Buffer for data read from disk.
   @type_trial,
   $real_name
     );

$cgi_lib::maxdata = 50000;

&ReadParse(\%in,\%cgi_cfn,\%cgi_ct,\%cgi_sfn);

print &PrintHeader;
print &HtmlTop("File Upload Results");


#GET ONLY THE FILENAME, NOT THE DIRECTORIES
if ($cgi_cfn{'upfile'}=~m/:\\/) {
 @type_trial = split /\\/,$cgi_cfn{'upfile'};
 $real_name = $type_trial[-1];
}
else {
 $real_name = $cgi_cfn{'upfile'};
}

print <<EOT;


<p>You've uploaded a file.
<br>
<p>
The file's reported name on the client machine is:
<i>$cgi_cfn{'upfile'}</i><br>
$real_name<br>

The file's reported Content-type (possibly none) was:
<i>$cgi_ct{'upfile'}</i><br>
$in{test}

EOT

print &HtmlBot;

open (UPLOAD, ">d:/web/wwwroot/abrhs/data/$real_name") || die "Can't
Open $real_name: $!\n";
binmode UPLOAD;
print UPLOAD "$in{'upfile'}";
close (UPLOAD);


}


---
You are currently subscribed to perl-win32-users as:
[walter@tscinternet.com]
To unsubscribe, forward this message to
         unsubscribe-perl-win32-users@lyris.activestate.com
For non-automated Mailing List support, send email to
         ListHelp@ActiveState.com


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch