After 4 hours of reading posts to try to solve this.....
I use the plugin to upload photos and return it to the Tinymce Editor. It works perfect in Chrome and Firefox but fails in IE. In the dev tools, it breaks in jquery.forms.js on line 474 as IE wont recognize the finally
statement. So I remove it and then I receive access denied when the same file calls form.submit()
. No matter what I can't sove this issue. I'm using Jquery v. 1.8.1
and Malsup Jquery Form Plugin v. 3.15
.
Here is the code:
$("#img-form").hide(); // hide the browse button
$("#image").change(function() {
$("#img-form").ajaxSubmit(options); // upload the file directly after selection
});
/*
* set options for jQuery form plugin
*/
var options = {
cache: false,
contentType:"text/html",
type: 'POST',
url: "../upload.php",
data: { width: w, height: h, bounds: b },
success: showResponse // post-submit callback
};
function showResponse(responseText, statusText, xhr, $form) {
var obj = JSON.parse(responseText);
var state = obj.state;
var response = obj.response;
if(state) {
tinyMCE.execCommand('mceInsertContent', false, response); // place the image into the editor
} else {
alert(response);
}
}
Any help at all and you will save my sanity, thanks!
It turns out this is 100% not possible. Since I opened the file browser via a triggered click
and not by an actual user clicking the button, IE will no way no how allow you to submit a form for security reasons. I had to have the user click the file input manually and then the form plugin did it's magic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With