File uploader sometimes fails with "Error uploading file"