handle permissions errors and files that change size during upload