Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Order of attachments in Multipart POST

Reply
Thread Tools

Order of attachments in Multipart POST

 
 
David Wake
Guest
Posts: n/a
 
      09-30-2003
Does anyone know of a way to control the order of file attachments
sent in a multipart POST statement? They seem to be sent in a random
order each time.


use HTTP::Request::Common;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

my $response = $ua->request(POST 'http://www.foo.com/forminput.cgi,
Content_Type => 'form-data',
Content => [
file1 => ["/home/dwake/file1"],
file2 => ["/home/dwake/file2"],
] );

The order in which file1 and file2 are attached seems to vary each
time this script is run. I would like to always send them in the same
order if possible.

Thanks,

David
 
Reply With Quote
 
 
 
 
Tulan W. Hu
Guest
Posts: n/a
 
      10-03-2003
"David Wake" <(E-Mail Removed)> wrote in message...
> Does anyone know of a way to control the order of file attachments
> sent in a multipart POST statement? They seem to be sent in a random
> order each time.
>
>
> use HTTP::Request::Common;
> use LWP::UserAgent;
> my $ua = LWP::UserAgent->new;
>
> my $response = $ua->request(POST 'http://www.foo.com/forminput.cgi,
> Content_Type => 'form-data',
> Content => [
> file1 => ["/home/dwake/file1"],
> file2 => ["/home/dwake/file2"],
> ] );
>
> The order in which file1 and file2 are attached seems to vary each
> time this script is run. I would like to always send them in the same
> order if possible.


Why do you need to care about the order of the files?
Use CGI module in the forminput.cgi and
$query->param('file1') and $query->param('file2') will allow
you to get the individual files. The order is not important.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
multipart/form-data Post LD ASP .Net 3 09-23-2008 01:37 PM
MIME Structure Multipart/Mixed with attachment and Multipart/Alternative blaine@worldweb.com Perl Misc 1 04-04-2007 08:23 PM
Accessing the PostedFile object of a multipart/form-data post Abe Simpson ASP .Net 2 12-07-2005 08:33 PM
multipart attachments in Thunderbird morten lund Firefox 0 11-04-2004 02:13 PM
Scripting HTTP POST - multipart/form-data Jeff Shannon Python 4 07-21-2004 12:24 AM



Advertisments