Updated handleUploadedFile method to properly handle base64 uploaded files.