I'd like to expand on zentara's reply a bit. As he states, file uploads are initiated from the browser when they see a <INPUT TYPE=FILE> HTML tag. So you can automate upload using LWP. as shown in his example. In that case, you need that script to run instead of the normal browser initiated upload. The big disadvantage there is that you have to offer your Perl script as the UI instead of using the browser and its built in file selection capabilities. When browsers see the <INPUT TYPE=FILE> tag, they offer up the file selection dialog that lets you pick the file to be uploaded.

If you want to use the browser your options for multiple files are more limited. Some browsers support up to 5 <INPUT TYPE=FILE> tags and let you pick up to 5 files for upload, but that's not universal. Because of the file number limitation in the browser, your options for using JavaScript or other DHTML are also therefore limited, but I have seen some references to dynamic client side methods for handling this, so there may be more possible there than I think there is. All the ones I ran across when investigating this simply made use of 1-5 upload tags.

In either case, you need something on the server side to accept and process the upload requests. That's easily done using Perl. For example, I have written server side CGI's that take zip files from browser clients and unpack them on the server. But there's no way to automate zip creation from the browser on the other end. About the best you can do is accept different file types and key your actions off the type (e.g., the file suffix). You could do something with a Java applet here but I'm now in over my head. 8-)


In reply to Re: Directory Upload by steves
in thread Directory Upload by mvidican

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.