Hi,

I've got a really annoying thing going on here with CGI.pm :/

At first - I thought it was just cos I was tired, and was missing something stupid... but I really can't see it (even now, the morning after)

The code in question is:

use CGI; my $cgi = new CGI; my $fh = $cgi->upload('client_local_offer_image_url'); print $IN->header; print STDERR "HERE ... \n"; while (< $fh >) { print STDERR $_ ; } print "HERE"; exit;


...and the HTML (I've cut some of it out, as its about 800 lines long, and I'm sure you don't wanna see all of it <G>)

<form name="offerForm" id="offerForm" action="/form.cgi" method="post" + enctype="multipart/form-data"> <input type="hidden" name="action" value="catalog_online" /> <input type="hidden" name="do" value="client_manage" /> <input type="hidden" name="func" value="add_do" /> <input type="hidden" name="user_client_id" value="1" /> <table width="100%" border="0" cellspacing="0" cellpadding="4" bgcolor +="#DDE8F4"> <tr bgcolor="#6699CC"> <td colspan="2" height="1" width="100%" class="background_bleu +_fonce_top"><img src="http://images.site.org/images/v2/clear_shim.gif +" width="10" height="1" border="0"><br></td> </tr> <tr> <td width="43%" align="right"><font face="Verdana,Arial,Helvet +ica" size=2 color="#191C1F">Title:</td> <td><font face="Verdana,Arial,Helvetica" size=2 color="#191C1F +"><input type="text" class="button required" name="client_local_offer +_title" size="40" value=""> *</td> </tr> ... more HTML and options <tr> <td width="43%" align="right"><font face="Verdana,Arial,Helvet +ica" size=2 color="#191C1F">Image:</td> <td><font face="Verdana,Arial,Helvetica" size=2 color="#191C1F +"><input type="file" class="button" name="client_local_offer_image_ur +l" size="40"> *</td> </tr> ... more HTML and options </table> </form>


When submitting the form, it submits, BUT nothing ever comes through in the image field that was submitted!

At first, I thought it was a problem with the enctype, but that all appears to be there fine

Can anyone have a look with a fresh pair of eyes, and see if they can spot the boo-boo? I've spent over 3 hours trying to work it out, and I'm still no closer :( (I've done file uploads a ton of times before - which is why I can't work out why this wont work :/)

TIA!

Andy

In reply to File upload is refusing to work by ultranerds

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.