Check if 'UPLOAD_DIR' env variable is set, if not allow tempfile to determine pathway. Delete temp directory after successful upload.