Better handling for temp file deletion and upload limits