Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vito-mohagheghian/85bb25b06e620ea2d64598c0b3c88b2d to your computer and use it in GitHub Desktop.
Save vito-mohagheghian/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