Hello everybody,
I'm working with CKEditor and I have the following problem.
In order to insert an image on my local machine into the text editor, I need first to upload the image to the server, then get back its url.
As I'm working with Java Servlet, my code is as follow :
CKEDITOR.replace(this.rteid, {
filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?Type=Images',
filebrowserImageUploadUrl : 'TransfertServlet'
});
it means when I click the button "Upload it to server", the Java Servlet named "TransfertServlet" is called.
My question is : how can i send back the url of the image so that I can insert it to my text ?
Thank you for your help !
Gia
I'm working with CKEditor and I have the following problem.
In order to insert an image on my local machine into the text editor, I need first to upload the image to the server, then get back its url.
As I'm working with Java Servlet, my code is as follow :
CKEDITOR.replace(this.rteid, {
filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?Type=Images',
filebrowserImageUploadUrl : 'TransfertServlet'
});
it means when I click the button "Upload it to server", the Java Servlet named "TransfertServlet" is called.
My question is : how can i send back the url of the image so that I can insert it to my text ?
Thank you for your help !
Gia
Re: Get Url of a file uploaded by a Java Servlet
In the resulting HTML generated by your servlet.. i believe you will need to call a Javascript function in ckeditor. The call would look something like this:
window.opener.CKEDITOR.tools.callFunction( funcNum, fileUrl [, data] );
An example would be:
Re: Get Url of a file uploaded by a Java Servlet
Thank you for your answer.
In fact, your code doesn't work as is, because of this line :
*** window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
I've changed it to
*** window.parent.CKEDITOR.tools.callFunction(funcNum, fileUrl);
and it worked !
Thanks
Gia
Re: Get Url of a file uploaded by a Java Servlet