[Fwd: AspUpload + libwww-perl]

C.J. Collier (nytshade@sinclair.net)
Fri, 18 Aug 2000 11:23:59 -0700


--------------8743FEFE5651F9C8E5DE26E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I was wondering if there was an easy way to have LWP use 10 -'s as MIME
delimiters.  Any suggestions?

C.J.

--------------8743FEFE5651F9C8E5DE26E0
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Return-Path: <peter@persits.com>
Received: from atlantech.net (staq1.atlantech.net [209.190.212.3])
	by mail.tscnet.net (8.9.3/8.9.3) with ESMTP id QAA16180
	for <cjcollier@sinclair.net>; Thu, 17 Aug 2000 16:14:09 -0700
Received: from [209.183.207.254] (HELO moscow)
  by atlantech.net (CommuniGate Pro SMTP 3.3.1)
  with SMTP id 3104035 for cjcollier@sinclair.net; Thu, 17 Aug 2000 19:15:40 -0400
Message-ID: <169201c008a0$cef6e350$0201a8c0@moscow>
From: "Peter Persits" <peter@persits.com>
To: "C.J. Collier" <cjcollier@sinclair.net>
References: <399C4B94.B1FAC41B@sinclair.net>
Subject: Re: AspUpload + libwww-perl
Date: Thu, 17 Aug 2000 19:13:51 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700

AspUpload expects MIME delimiters to start with at least 10 '-' characters:

--------------ASDFGHJKL:

If this is not the case you will have the error you are getting. Although
this is not strictly an RFC1867 requirement, all browsers follow it, so we
decided to enforce it too. Your CGI script apparently does not follow this
pattern.

Peter Persits
Persits Software, Inc.
http://www.persits.com


----- Original Message -----
From: "C.J. Collier" <cjcollier@sinclair.net>
To: <support@persits.com>
Sent: Thursday, August 17, 2000 4:31 PM
Subject: AspUpload + libwww-perl


> We are looking into your product as a solution to data transfers between
> linux and windows machines as a portion of a product we will be rolling
> out, but are having problems automating the process.  An upload from a
> browser to an AspUpload page works fine, but uploads from a libwww-perl
> user agent fails with a CGI built from AspUpload where it succeeds
> uploading to a CGI built with perl's CGI.pm.
>
> Some specifics:
>
> the linux engine is using LWP v5.22
> the windows machine is a win2k machine using IIS & asp with the latest
> test version of your AspUpload product.
>
> An attempted upload creates this entry, for example in the log:
>
> 2000-08-16 19:27:06 208.49.9.97 - 216.160.122.251 80 POST
> /SecurityPortalAdmin/PostAlerts/XMLUploadFile.asp
>
|6|800a000e|Invalid_data_format._You_must_include_ENCTYPE=_multipart/form-da
ta__in_your_FORM.|192|80020009|Exception_occurred.__
> 500 libwww-perl/5.48
>
> Here is the perl code for the CGI that accepts the file:
>
> ----------------------------------------------------
>
> #!/usr/bin/perl
>
> use CGI qw(:standard);
> use HTTP::File;
>
> $upload_path='/tmp';
>
> $raw_file = param('XMLFILE');
> $basename = HTTP::File::upload($raw_file,$upload_path);
> $submit = param('Submit');
>
> print (header,
>        start_html,
>        "<B>$basename</B> upload successfully.<BR>Upload path: ",
>        $upload_path ? $upload_path : '/tmp',
>        "<br>The text in bold is what you should input to the ",
>        "HTTP::File test script<BR><BR>",
>        "Submit = <B>$submit</B>",
>        end_html
>        );
>
> ---------------------------------------------------
>
> and here is an example of the code that is used to upload to a CGI:
>
> ---------------------------------------------------
>
> #!/usr/bin/perl -w
> use strict;
> use HTTP::Request::Common;
> use LWP::UserAgent;
>
> my $filename = "test.xml";
>
> my $url='win2kbox/upload.asp';
> #my $url='localhost/upload.cgi';
>
> my $req = POST $url,
>   Content_Type   => 'form-data',
>   Content        => [XMLFILE => [$filename],
>                              Action  => 'Upload File'
>                             ];
> $req->authorization_basic('administrator','');
>
> my $res = LWP::UserAgent->new->request($req);
>
> print $res->is_success ? $res->content : $res->status_line,"\n";
>
> --------------------------------------------------
>
> Again, we are interested in using your product if we can make it work in
> a production environment,
>
> C.J. Collier
>
> Lead developer,  SecurityPortal
>
> www.securityportal.com
>

--------------8743FEFE5651F9C8E5DE26E0--