changed logic of upload temporary file.