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

How can I remove base64 content when I upload image? #127

Closed
horan-geeker opened this issue Apr 4, 2018 · 8 comments
Closed

How can I remove base64 content when I upload image? #127

horan-geeker opened this issue Apr 4, 2018 · 8 comments
Labels

Comments

@horan-geeker
Copy link

horan-geeker commented Apr 4, 2018

First, thanks for your job!

Version

1.0.5

Test Environment

Mac Chrome

Current Behavior

I have use addImageBlobHook callback to upload image, but Base64 also insert into textarea

addImageBlobHook: function (blob, callback) {
                            var uploadedImageURL = that.imageUpload(blob);
                            callback(uploadedImageURL, 'alt text');
                            return false;
                        }

content like this, appear twice

![alt text](image url)![ie.png](data:image/png;base64,iVBORw0KGgoAA......

Expected Behavior

only my code here

![alt text](image url)

so, how can I remove base64 code when I upload a image?

@kyuwoo-choi
Copy link
Member

oh well.
The code snippet you wrote should work fine.
the base64 image string should be replaced with uploaded URL.

I have tested it now and I can't reproduce.
will you post your example on codepen or somewhere?

@horan-geeker
Copy link
Author

Sorry to tell that I can't upload tui-editor.js and other files on codeopen, so I post them on my own server where you can see the source code from the follow page.

this is my server address http://115.28.82.133/example00-demo.html you can drop a file into content block and do a test. the truth is that it appeared twice, I don't know if I use it in a wrong case.

I have downloaded project zip file, there are three file in dist/ directory tui-editor-Editor-all.js, tui-editor.css and tui-editor-contents.css I have include them in my demo, as for other js and css files I copied urls from your example page example00-demo.html

@toby1991
Copy link

toby1991 commented Apr 8, 2018

image

@horan-geeker You wrote the addImageBlobHook in the events, but it is a hooks, dude.

image

@kyuwoo-choi This issue should be closed.

@horan-geeker
Copy link
Author

Sorry, It's my fault, thank u @toby1991

@kyuwoo-choi
Copy link
Member

I think we can close this issue.

@wangchongchong1007
Copy link

@horan-geeker hi, I found if I remove the base64 content the preview of the picture will disappear. So how should I replace the base64 code?

@horan-geeker
Copy link
Author

@wangchongchong1007 you need use addImageBlobHook in hooks section, and the page will only has a href without any base64 code.

@js87zz
Copy link
Contributor

js87zz commented Jul 1, 2021

@2KLM
Please open a new issue instead of asking questions about the closed issue. The maintainer(kyuwoo-choi) is no longer involved in this project.

@nhn nhn locked as resolved and limited conversation to collaborators Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants