Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-21 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found