Improved file upload