assemblee-virtuelle / assemblee-virtuelle/semapps
Upload multiple images through react-mde
- Dominant language
- TypeScript
- Stars
- 103
- Forks
- 14
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Description
Example in https://codesandbox.io/p/sandbox/react-typescript-icqgv?file=%2Fsrc%2Findex.tsx

We only need to add this prop:
```jsx
```
With the `save` function looking like this:
```js
const save = async function*(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 markdown
yield "https://picsum.photos/300";
// returns true meaning that the save was successful
return true;
};
```
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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.