I've got a website setup for employees to upload large files to so that they may be downloaded by external users. The files sent through this site are routinely 2+ GB and I'm looking for a way to streamline the processing.

I'm using swfupload on the client end to make it easy for the users and it's been working happily for many years. Recently however the files are getting even larger and I've noticed that the way CGI is handing the uploads isn't too efficient.

The upload is streamed into a temporary directory on the c: drive. Once the client finishes POSTing it would seem that the file is then copied to it's final location on the d: and then deleted from c:. I tried changing the temp location to d:, but I still have to wait while the OS makes a copy of the 3GB file before deleting the CGITemp one.

Aside from taking double disk space during the process, the copy delay can be long, and the client see's their download stuck at 100% (via swfupload).

So my question is, how do I force CGI to write directly to the final desired handle and location, bypassing the CGITemp process? I looked into the hook feature, but as far as I understand it, that is only a means to monitor the upload process. I tried setting 'use_tempfile' to 0, and was successful as far as I could tell, but that just made the CGITemp file write to c:\windows\temp instead.


In reply to CGI upload efficiency by Talroot

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.