I'm using a route to save the images on S3, but when I take a screenshot and paste it, it gives an error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- aws, react, typescript
Research direction
Start at the onPastImage handler and its MDEditor onPaste entry point, then inspect the uploadImagesService request and the route it calls. Reproduce pasting a screenshot and compare the request with the response; the issue is done when the image upload no longer returns 404.
Written by the indexing model from the issue text.
Description
I'm using OnPaste to store my save function in S3, but it's giving 404, could anyone help me solve this problem? here is the code.
`
async function onPastImage(event: React.ClipboardEvent) {
var items = event.clipboardData?.items;
if (items) {
for (var i = 0; i < items.length; i++) {
if (items[i].type.indexOf('image') !== -1) {
//image
let image = items[i].getAsFile();
if (image) {
let imageUpload: File;
imageUpload = new File([image], 'image.png');
console.log('upload', imageUpload);
const formData = new FormData();
console.log('const', formData);
formData.append('image', imageUpload);
console.log('image', formData);
await uploadImagesService(formData);
}
}
}
}
}
`
<MDEditor
value={doc}
onPaste={onPastImage}
onChange={(event) => {
if (event === undefined) {
return;
}
setDoc(event);
}}
/>
- Dominant language
- TypeScript
- Stars
- 350
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uiwjs/react-markdown-preview
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
uiwjs/react-markdown-preview#292 ·
-
Error when evaluating SSR module virtual:react-router/server-build: Unknown file extension ".css"Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
uiwjs/react-markdown-preview#288 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
uiwjs/react-markdown-preview#287 · 1 comment ·
-
Bundle too heavy?Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
uiwjs/react-markdown-preview#286 · 1 comment ·
-
Strikethrough Error!Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
uiwjs/react-markdown-preview#284 · 1 comment ·
All issues in uiwjs/react-markdown-preview
Similar issues
-
bot:ai-assisted status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
midnightntwrk/midnight-js#1424 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mksglu/context-mode#1268 ·
Maintainers usually reply within 5 days
-
[bug] Setup fails with "Cannot find matching keyid" when an older Node's corepack is on PATHPossibly taken @EyalPoly claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MystenLabs/MemWal#1124 · 2 comments ·
Maintainers usually reply within 1 day
-
Edit:Opencheck:failed streams:edit
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
iptv-org/iptv#54352 · 1 comment ·
Maintainers usually reply within 1 day