Results 1 to 2 of 2

Thread: supporting file upload from perl client script

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Cincinnati Ohio
    Posts
    40

    Default supporting file upload from perl client script

    Hello all,

    I want to upload a log file from a perl script to a file on the server using
    post and multipart request.

    I have the file upload working when the form is triggered from an html page, but I am having problems when creating the request from the perl script.

    (I am not a perl guru, so sorry if this is a stupid user perl problem).

    I can process the perl script generated HTTP request from a servlet using the commons mult-part file handling without spring.

    How do I do this with spring?

    HTML approach:
    1) create fileUpload.html that contains a form, submit action is: upload.form

    Perl Client Approach:

    my $req = POST $URL_submit, Content_Type => 'multipart/form-data',
    Content => [ FirstName => 'Foo',
    LastName => 'Bar',
    filename => [ $cov_file ]
    ];

    my $res = $ua->request($req) or die "request: $!";



    Stupid Questions:
    1) From perl, do I Post to the same upload.form that I post the HTML?
    2) Do I have to do anything special in the Spring setup
    The greatest performance improvement is the transition from a non-working state to the working state...

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    I want to upload a log file from a perl script to a file on the server using post and multipart request
    If you're on Unix or Cygwin, you might be interested in doing this with cURL which can do it more simply.

    1) From perl, do I Post to the same upload.form that I post the HTML?
    Well, you must POST to the correct URL. If you're not sure what's going on, try sniffing the traffic with Ethereal.

    2) Do I have to do anything special in the Spring setup
    If you can get an upload working with a browser, you should be able to get it working with PERL.

Similar Threads

  1. Cannot upload file using web flow
    By mcsenter in forum Web Flow
    Replies: 5
    Last Post: Mar 7th, 2011, 09:10 PM
  2. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  3. Deferred file upload
    By Thomas Matzner in forum Web
    Replies: 4
    Last Post: Sep 30th, 2005, 12:06 PM
  4. Replies: 1
    Last Post: Jun 16th, 2005, 04:30 AM
  5. Replies: 0
    Last Post: May 24th, 2005, 01:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •