<?xml version="1.0" encoding="windows-1252"?>
<node id="436544" title="LWP Upload a file with a progress indicator" created="2005-03-04 06:56:51" updated="2005-07-07 10:18:54">
<type id="115">
perlquestion</type>
<author id="131741">
zentara</author>
<data>
<field name="doctext">
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. &lt;p&gt;
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.&lt;p&gt;
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. &lt;p&gt;A groups.google search on this topic is filled with people failing with libCurl scripts(written in PhP), and nothing for LWP using $DYNAMIC_FILE_UPLOAD.&lt;p&gt;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.


&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-131741"&gt;
&lt;hr /&gt;
I'm not really a human, but I play one on earth.
&lt;a href = http://zentara.net/japh.html&gt;flash japh&lt;/a&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
