Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload image only on trigger #45

Closed
Th1nhNg0 opened this issue Oct 25, 2024 · 5 comments
Closed

Upload image only on trigger #45

Th1nhNg0 opened this issue Oct 25, 2024 · 5 comments

Comments

@Th1nhNg0
Copy link

Hey, I want to add image to the editor but only upload to my server when I click save, how can i do that?

@Aslam97
Copy link
Owner

Aslam97 commented Oct 25, 2024

@Th1nhNg0 You can use blobUrl. In order to do this, you have to set allowBase64 to false. Also, you don't need uploadFn. And when user submits the form, get the content of the editor, then collect all the image URLs and start uploading the images. After the images are successfully uploaded, replace the images with new URLs.

@Aslam97
Copy link
Owner

Aslam97 commented Oct 25, 2024

@Th1nhNg0 I just added new feature called onImageRemoved and you can specify an id to it, so I gues you dont have to worry about images that are not used on the server

take a look
#46

@Th1nhNg0
Copy link
Author

@Aslam97 wow, this is what I'm looking for, thank you

@Aslam97
Copy link
Owner

Aslam97 commented Oct 25, 2024

@Th1nhNg0 Note that onImageRemoved is only triggered when the image has a real URL. If the image source is a blob or base64, onImageRemoved will not be triggered.

@Aslam97
Copy link
Owner

Aslam97 commented Oct 25, 2024

@Th1nhNg0 If thats solve your problem, I will close this issue for now. feel free reopen the issue.

@Aslam97 Aslam97 closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants