How to handle broken file uploads?