I think the last line is that bit that made the crucial difference. I didn't know that about 'read'.

I'm glad you've got everything working, but I doubt that the check for read failure was the cause of your problems.

Annoying general advice follows... please feel free to ignore :-)

Unless what you're doing is urgent, I would spend the time and figure out the exact cause of the problem. Take your failing code and add some print statements to find out what's going on, remove code that's not relevant, etc. until the error goes - then back up a step. Look at what caused the error. Try and see why you did it that way - that way you can avoid the problem in the future.

Also, unless you know exactly what caused the error - you don't know 100% that you've fixed it. Maybe there is an edge case somewhere that you're missing?

Learning from your mistakes is a terrible cliche I know, but it's true nevertheless. It's better to learn how to not put the bugs in, rather than learn how to fix the bugs :-)


In reply to Find out what the bug was (was Yet another CGI Upload problem - not like the others!) by adrianh
in thread Yet another CGI Upload problem - not like the others! by stuayres

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.