Untitled

 avatar
unknown
plain_text
a month ago
790 B
2
Indexable
const updatedFiles = fileItems.map((fileItem) => {
      if (fileItem.file instanceof Blob) {
        // Convert Blob to File
        const fileName = "uploaded_image.jpg"; // Set your desired file name
        const file = new File([fileItem.file], fileName, {
          type: "image/jpeg", // Set MIME type for the image, adjust as needed
        });
        
        console.log("filepond",file);
        
        // Return thfilee updated fileItem with the new File object
        return { ...fileItem, file }; // Replace Blob with File object
      }
      console.log("filepond2",fileItem);
      return fileItem; // No need to update if not a Blob
    });
 
    // Set the updated files, with Blobs converted to Files if needed
    
    setFileImage(updatedFiles);
Editor is loading...
Leave a Comment