Menu

In case of cancel uploading,delete temp file.

2004-11-20
2013-03-27
  • Edward Jang

    Edward Jang - 2004-11-20

    In case of cancel uploading,
    there is a temporary file in /tmp directory.

    It is a problem to me.
    If someone cancel uploading a file, the temporary file must be deleted.

    If anyone has a good idea, please inform me of the solution.

    Thanks in advance.

     
    • the real duch

      the real duch - 2004-12-07

      set a cron job that erase any file that mega upload uses and that has not been modified for... let's say, one hour?

       
    • Terence Johnson

      Terence Johnson - 2005-01-21

      Clearing up the temp files without a cron job is fairly easy - just move responsibility for getting rid of the temp files to upload.cgi.

      I've modified my upload.cgi by adding the following lines to the end:

      eval {
          unlink "$user_dir/flength";
          unlink "$user_dir/postdata";
          rmdir $user_dir;
      };

      And progress.cgi to assume the upload has finished if it can't find the files, unless it's within five seconds of the upload start time.

       

Log in to post a comment.