Skip to content
Snippets Groups Projects
Commit 28bb18da authored by juanf's avatar juanf
Browse files

SSDM-4718 : CKEditor images upload support on the server

SVN: 38272
parent 5659bd45
No related branches found
No related tags found
No related merge requests found
......@@ -151,13 +151,10 @@ public class FileServiceServlet extends AbstractServlet
operationLog.info(multipartFile.getSize() + " bytes have been uploaded for file '"
+ originalFilename + "' and stored in '" + filePath + "'.");
response.setContentType("application/json");
response.setStatus(HttpServletResponse.SC_OK);
writeResponse(response, "{\n" +
" \"uploaded\": 1,\n" +
" \"fileName\": \"foo.jpg\",\n" +
" \"url\": \"/openbis" + APP_PREFIX + filePath + "\"\n" +
"}");
String imageURL = "/openbis" + APP_PREFIX + filePath;
String funcNum = multipartRequest.getParameter("CKEditorFuncNum");
writeResponse(response, "<script>window.parent.CKEDITOR.tools.callFunction(" + funcNum + ", \"" + imageURL + "\");</script>");
}
private void writeError(HttpServletResponse response, String message) throws IOException
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment