Handle an uploaded file