Check whether file exists before upload.