Order of attachments in Multipart POST

Discussion in 'Perl Misc' started by David Wake, Sep 30, 2003.

  1. David Wake

    David Wake Guest

    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
    David Wake, Sep 30, 2003
    #1
    1. Advertising

  2. David Wake

    Tulan W. Hu Guest

    "David Wake" <> 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.
    Tulan W. Hu, Oct 3, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LD

    multipart/form-data Post

    LD, Aug 27, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    15,249
    navyjax2
    Sep 23, 2008
  2. Abe Simpson
    Replies:
    2
    Views:
    2,036
    Abe Simpson
    Dec 7, 2005
  3. codewarrior
    Replies:
    0
    Views:
    518
    codewarrior
    May 4, 2009
  4. Peter Green
    Replies:
    0
    Views:
    629
    Peter Green
    Nov 5, 2009
  5. Replies:
    1
    Views:
    389
Loading...

Share This Page