Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi, Someone asked elsewhere, about how to get a progress indicator on a file upload. I am not talking about using a browser, but with something like LWP or libCurl.

There seems to be a way with libCurl,according to the docs, but I have yet to get anything to work. There are so many interrealted libcurl options, I've havn't been able to get it to put out the right headers for a multipart form file upload, and I'm not even close tothe file part.

With LWP, it's quite easy to do the upload with HTTP::Request::Common, but it does not have a way to do "chunked uploads" where we can extract progress from. By looking at the docs, there is some mention of $DYNAMIC_FILE_UPLOAD, but I've yet to see a snippet which works.

A search on this topic is filled with people failing with libCurl scripts(written in PhP), and nothing for LWP using $DYNAMIC_FILE_UPLOAD.

So does anyone have a minimal script, showing how to upload a file with either libCurl, or LWP, and have a progress callback of some sort? I am still working on it, but I'm to the point of guessing at options and headers, :-) so I figure it's time to ask.

I'm not really a human, but I play one on earth. flash japh

In reply to LWP Upload a file with a progress indicator by zentara

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2023-09-30 13:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found