automate file upload using perl

Discussion in 'Perl' started by [nix], Sep 7, 2003.

  1. [nix]

    [nix] Guest

    Hi,

    I'm trying to automate a process to upload a file to hotmail, but
    having a strange error and I don't know what I'm doing wrong with the
    script.

    below is the code:

    use HTTP::Request::Common;
    use LWP;

    -- snipped --

    $ua = new LWP::UserAgent;
    $ua->agent('Mozilla/5.0 (compatible; MSIE 5.5; Windows 98; Win 9x;
    Windows 2000)');

    $response = $ua->request(POST
    'http://by7fd.bay7.hotmail.msn.com/cgi-bin/doattach',
    Content_Type => 'form-data',
    Content => [ curmbox => 'F000000001',
    HrsTest => '',
    attachmentfilename => '',
    attachorcancel => '',
    userfilename => '',
    contentType => '',
    smsg => 'jaja.saved',
    attfiles => '',
    stationery => '',
    originalstationery => '',
    ref => '',
    RTEbgcolor => '',
    from => 'compose',
    oldattfile => '',
    _HMAction => '',
    attfile => ['./text.txt'],
    ]
    );

    print ($response->is_success) ? $response->content :
    $response->status_line;


    The error message returned:
    <!-- counter(177) >= nLines(177)! -->
    <!-- H: bay7-f64.bay7.hotmail.com -->
    <!-- V: WIN2K 09.07.50.0039 i -->
    <!-- D: Sep 3 2003 18:03:53-->
    <!-- S: 0-->


    I'd appreciate very much if somebody could enlight me with some
    inputs.

    Thanks.
    [nix], Sep 7, 2003
    #1
    1. Advertising

  2. [nix]

    [nix] Guest

    oh, never mind.. it works like charm after I put Content_Length.

    ([nix]) wrote in message news:<>...
    > Hi,
    >
    > I'm trying to automate a process to upload a file to hotmail, but
    > having a strange error and I don't know what I'm doing wrong with the
    > script.
    >
    > below is the code:
    >
    > use HTTP::Request::Common;
    > use LWP;
    >
    > -- snipped --
    >
    > $ua = new LWP::UserAgent;
    > $ua->agent('Mozilla/5.0 (compatible; MSIE 5.5; Windows 98; Win 9x;
    > Windows 2000)');
    >
    > $response = $ua->request(POST
    > 'http://by7fd.bay7.hotmail.msn.com/cgi-bin/doattach',
    > Content_Type => 'form-data',
    > Content => [ curmbox => 'F000000001',
    > HrsTest => '',
    > attachmentfilename => '',
    > attachorcancel => '',
    > userfilename => '',
    > contentType => '',
    > smsg => 'jaja.saved',
    > attfiles => '',
    > stationery => '',
    > originalstationery => '',
    > ref => '',
    > RTEbgcolor => '',
    > from => 'compose',
    > oldattfile => '',
    > _HMAction => '',
    > attfile => ['./text.txt'],
    > ]
    > );
    >
    > print ($response->is_success) ? $response->content :
    > $response->status_line;
    >
    >
    > The error message returned:
    > <!-- counter(177) >= nLines(177)! -->
    > <!-- H: bay7-f64.bay7.hotmail.com -->
    > <!-- V: WIN2K 09.07.50.0039 i -->
    > <!-- D: Sep 3 2003 18:03:53-->
    > <!-- S: 0-->
    >
    >
    > I'd appreciate very much if somebody could enlight me with some
    > inputs.
    >
    > Thanks.
    [nix], Sep 7, 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. [nix]

    automate file upload using perl

    [nix], Sep 7, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    92
    Brian McCauley
    Sep 7, 2003
  2. tester

    automate website login using perl

    tester, Sep 23, 2005, in forum: Perl Misc
    Replies:
    12
    Views:
    413
  3. perlperl

    automate command line script using perl

    perlperl, Jun 15, 2006, in forum: Perl Misc
    Replies:
    6
    Views:
    357
    perlperl
    Jun 16, 2006
  4. king
    Replies:
    2
    Views:
    169
  5. lofenee
    Replies:
    5
    Views:
    206
    lofenee
    Jul 15, 2008
Loading...

Share This Page