You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constsave=asyncfunction*(data,file){// Upload "data" to your server// Use XMLHttpRequest.send to send a FormData object containing// "data"// Check this question: https://stackoverflow.com/questions/18055422/how-to-receive-php-image-data-over-copy-n-paste-javascript-with-xmlhttprequest// yields the URL that should be inserted in the markdownyield"https://picsum.photos/300";// returns true meaning that the save was successfulreturntrue;};
The data param is an ArrayBuffer, while file seems to be a regular File.
To make it work, we would only need to move the uploadFile util to the data provider interface.
Estimate time: half a day
The text was updated successfully, but these errors were encountered:
Example in https://codesandbox.io/p/sandbox/react-typescript-icqgv?file=%2Fsrc%2Findex.tsx
We only need to add this prop:
With the
save
function looking like this:The
data
param is an ArrayBuffer, whilefile
seems to be a regularFile
.To make it work, we would only need to move the
uploadFile
util to the data provider interface.Estimate time: half a day
The text was updated successfully, but these errors were encountered: