Pass original filename to images_upload_handler: TinyMCE
See original GitHub issueI have this in set up,
tinymce.init({
selector: "textarea",
automatic_uploads: true,
images_reuse_filename: true,
images_upload_handler: function (blobInfo, success, failure) {
var xhr, formData;
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open('POST', '/cloud/tinymce/');
xhr.onload = function() {
var json;
if (xhr.status != 200) {
failure('HTTP Error: ' + xhr.status);
return;
}
json = JSON.parse(xhr.responseText);
if (!json || typeof json.location != 'string') {
failure('Invalid JSON: ' + xhr.responseText);
return;
}
success(json.location);
};
formData = new FormData();
formData.append('file', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
},
});
When I upload an image, with name like cauliflower_chorizo.png
, its renamed to blobid0.jpg
https://s3-us-west-1.amazonaws.com/happyherbivoretest/2017/05/blobid0.jpg
.
Is there a way to upload the image with it’s original name cauliflower_chorizo.png
?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Image & file options | Docs - TinyMCE
By default TinyMCE will generate unique filename for each uploaded file (for details ... images_upload_url should pass along credentials (such as cookies, ...
Read more >TinyMCE: Rename Image File Name Before Upload
What I want to do is capture the original filename, check it against a validFilenameChars function, then present the filename to the user...
Read more >Image Tools Image upload filenames - TinyMCE
Any way to pass the real image name? ... //need to rememeber the original filename var setImageData = function(contentDocument){ var ...
Read more >Sample code TinyMce image upload - MSDN - Microsoft
To enable user to upload image file and display it in TinyMCE editor, ... image code', images_upload_handler: function (blobInfo, success, ...
Read more >Tinymce 4.9.8 upload image - CodeIgniter Forums
images_upload_handler : function (blobInfo, success, failure, progress) { var xhr, formData; xhr = new XMLHttpRequest();
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
V4 tells us nothing, is it CDN/Cloud/SDK version? What 4.5.3? 4.1? 4.6? 4.6.1?
Hi @spocke, I’m using TinyMCE version 5.3.2 and I have the same issue with @alexkasina , it’s not fixed yet. Please check it. Thank you!
Update: The latest version still have this bug with using:
images_upload_handler