If you're doing base64 check the file length and set_argument_size to be sure the file isn't being chopped off.