Upload files testing & improvements

Yeah, you're right. I just copied this from the custom access function in `restful.module`.