Announcement Announcement Module
Collapse
No announcement yet.
supporting file upload from perl client script Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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.

    Comment

    Working...
    X