WIP: Copy file_save_upload() to get better error details