Make file upload more robust (avoid EXDEV error)