pokemonk, when you say it didn't work, what happened, nothing at all? Because the CGI upload can go wrong in several places, so tracing if anything was transferred to the server is important.

As usual, make sure of this:
1. Make sure you are sending the ENCTYPE as "multipart/form-data" in your form
2. Make sure you are using CGI.pm correctly to receive it.
3. You didn't mention the platform of the server and the client, because it's not unreasonable to check if it works differently with IE vs. Netscape, and what version you are using. The cgi.pm docs say that inconsistencies arise with different combinations of platform/webserver/browser.

To help you trace what is going on, remember that CGI.pm works by uploading the file to a temporary directory specified in the CGI module, depending on the server's platform. And then you transfer it to your desired location in your code. So if you can determine if the temp file is being created, then that would greatly help in your debugging.

Addition: (After reading your reply below): You say you are using windows - what webserver are you using? Since you are eventually going to use this on Unix, I would suggest testing your script now on Unix. The upload problem you have may not be in your code, but in the relationship between win/webserver/browser. This is explicitly stated by the author of cgi.pm. PerlMonks users have posted problems with upload on windows servers, and I have had personal experience with the inability to upload on pre-OS X Mac webservers. Try it on your Unix machine and it may work with no problem.

In reply to Re: Cgi Upload by fpi
in thread Cgi Upload by pokemonk

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.