Added prepareForUpload