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
Summernote Save Uploaded Images on Server #1173
Comments
Hi, I recently ran into the same type of problem where I wanted to implement onImageUpload so that images were uploaded to the server instead of stored as base64. The process is basically a two part solution:
There is probably a better way of doing it but here is what I am doing Included in the Editor.php file:
Now here is the code from the 'uploader.php' file:
Like I said, there is probably a better way to accomplish this but it works great for my purposes. |
Thanks @bbyrdhouse |
Recently, I wrote a blog about Rails solution on this. But I'm sorry it is written in Korean. |
@luciuschoi thank you so much. I was able to follow the post; however, I haven't implemented it yet. Thank you again for the great post. |
Fail for me: editor is undefined. |
Hi guys. i'm here after sometimes spent on other pretty buggy/paying editors (Tinymce/ckEditor). Now i need to be able to upload different type of files to my mysql/php server, and i'm going to try your given Ajax solution : is there a way to profit of image button to upload other files than images ? PS: yeah i have tested the video button and that's cool (dailymotion links still fail to show correctly though for all pepole ^^) and image button. Now i need an AnyFile button upload :) Thanks. |
Hi guys, The original summernote converts uploaded images to base64 format. |
Great job guys. i used the code and improvised it a little for the PHP users here. https://a1websitepro.com/store-image-uploads-on-server-with-summernote-not-base-64/ Thanks for the help I hope I can help someone too. :-) |
Are you guys aware there is https://github.com/summernote/awesome-summernote that already has plugins/addons for manipulating images? |
Yes but we were talking about "saving" images not manipulating them. :-) @diemendesign |
There are also a few that save them. |
Is there any solution of the use multiple summernote when file upload in nodejs? |
Guys, it is as simple as this, just update your summernote.js file and find where it reads: onImageUpload: null to the following: onImageUpload: function(files) { In your file-upload.cfm you should be receiveing a form.file varaible which is your selected file to upload, once uploaded, return the path to the file eg: https://www.test.com/example.jpg as a string and that should work like magic, just make sure when you apply your changes to the .js file that you clear your browser cache. |
This uploads the image but does not display image in editor while typing |
sdfg### ### |
I have summernote in my Rails 4 application. I understand that summernote converts images to base64 and once I submit it saves the images directly on the back-end database server. I'm using Mysql, and surprisingly with 3MB images I get weird errors complaining about losing connection to the database. I investigated the issue and it seems that the base64 string generated is too long which in turn creates a long request and mysql is then forced to drop the connection.
I tried to change the column datatype of my content to LongBlob; however, this doesn't fix the problem. The only way I can get around this is by uploading small images 300kb and so.
I think this is not how images are meant to be stored in the first place, and wonder if anyone has faced a similar problem, and how you can work around this to store the images directly on the server's file system say on a folder called /blog_images and then retrieve the images when needed.
I understand that I have to use onImageUpload function in my javascript, but have not managed to fully implement it correctly. If anyone can shed light on how to go about this it would be greatly appreciated.
The text was updated successfully, but these errors were encountered: