HI,
I am looking for functionality to allow user to paste image to TinyMCE content.
There is editor.uploadImages() function and I wonder if anyone managed to make it work.
Any suggestions how to do it from Wisej?
Thanx,
DiNo
Hi Dino,
I have attached the fixed project. These are the errors:
HTH
/Luca
Hi,
Please find attached sample with http handler defined and options set. But I am not able to get http handler firing ?
When you drag or paste the inage TinyMCE converts it to Base64 and keeps it in the HTML content, but i would like to avoid this.
Can you help please, feel free to upload it to examples when you manage to fix it , we should save time and nerves for others.
Regards,
D
More here:
https://www.tinymce.com/docs/get-started/upload-images/
I have added this to the options
"images_upload_url": "TinyMCE-ImageUpload.ashx", "images_upload_base_path": "/images"
and added a simple handler:
public class TinyMCE_ImageUpload : IHttpHandler { public void ProcessRequest(HttpContext context) { var request = context.Request; var response = context.Response; if (request.Files.Count > 0) { HttpPostedFile file = request.Files[0]; var filePath = "images/" + file.FileName; using (var image = new FileStream(request.MapPath(filePath), FileMode.Create, FileAccess.Write)) { file.InputStream.CopyTo(image); } response.Write($"{{\"location\":\"{file.FileName}\"}}"); } } public bool IsReusable { get { return true; } } }
There are of course many options and variations. It’s just plain asp.net or mvc handlers. You can also use a php handler on the server.
Please login first to submit.