Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mohammad-mghn/85bb25b06e620ea2d64598c0b3c88b2d to your computer and use it in GitHub Desktop.
Save mohammad-mghn/85bb25b06e620ea2d64598c0b3c88b2d to your computer and use it in GitHub Desktop.
const [cover, setCover] = useState<any>(); // paste this in tour component route
<FilePond
files={cover}
chunkUploads={true}
onupdatefiles={setCover}
server={{
process: {
url: <COULDINARY_API_UPLOAD_IMAGE>,
onerror: (error: any) => {
console.log(error);
},
ondata: (data: any) => {
data.append("file", cover[0]?.file);
data.append("could_name", <COULDINARY_NAME>);
data.append("upload_preset", <YOUR_CLOUDNIRY_NAME>);
return data;
},
},
}}
allowMultiple={false}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment