When a browser uploads a file to my server, via a cgi script, the script counts the bytes of the upload and stops accepting data when it reaches the specified maximum file size.

The script tells them, "File too big" and then closes the stdin.

The issue is that even if I exit the while(<STDIN>) loop and print a message to the screen, the user's browser still thinks the server is accepting the upload, and continues sending the entire file. The result is, the browser hangs as if it was sending this huge file.

Even printing a message doesn't seem to tell the browser to stop uploading.

Is there a reliable way to inform the browser to stop uploading? The server stopped accepeting data, so the browser needs to know! thanks...


In reply to STDIN and Browsers by gorillaman

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.