简体   繁体   中英

Tinymce Editor Copy from Word Issue

I am using Tinymce editor. In it there is an option for Paste from word. On the click action of it, it calls a function windowmanager.open

My objective is to display the existing content of the editor in the popup window.

I am passing the content using query string, but sometimes the content is too large and i get URI limit exceed error.

Please help me on how to pass the content to the view file.

var actualContent = ed.getBody().innerHTML;
ed.windowManager.open({
                                file : url + '/pasteword.php?preContent='+encodeURIComponent(actualContent),
                                width : 450,
                                height : 400,
                                inline : 1
                            }, {
                                plugin_url : url
                            });

Blatantly stiolen from the answers to this question

The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15). Note: Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths.

What to note is this line:

A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle

So there doesnt really seem to be any easy way for you to pass such a large string as you're trying to do, unless you have access to configuring the server and that it is possible to do such a configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM