When inserting and uploading images to a remote server, Ephox EditLive! for Java uses the HTTP POST protocol for greater security. The following properties are defined in the .xml configuration file for this purpose.
Using the HTTP POST method to insert and upload images offers a secure way of allowing end users to interact with the remote server that the images are to be stored on.
In order to upload local images to the remote server via HTTP, you will need a server-side image upload handler script that accepts the images on the server and stores them in the correct directory. This script is the same script that would be used for uploading any file to the server via the HTTP POST method. For example, when you use a file input element (i.e. <INPUT type="file">), the script specified in the ACTION attribute of the form element is used to upload the file to the server. This is the same script specified in EditLive! for Java to upload local images inserted into EditLive! for Java to the remote server.
EditLive! for Java can use any image upload script that complies with RFC for Form-based File Upload in HTML (RFC 1867).
The following settings for image upload must be set up in the Configuration Tool, in order to get image upload working correctly.
You should enter in this field the absolute URL of the image upload handler scripts to be used for uploading.
Example
URL = http://www.yourserver.com/scripts/someuploadscript
Note: Relative URLs may be used. In this case the URL will be relative to the location of the page in which EditLive! for Java is embedded.
You should enter in this field the absolute URL for where the images are to be uploaded. The images can then be found by directing your browser to the images directory of the URL you supplied, after they have been uploaded.
Example
BASE = http://www.yourserver.com/userimages/
Note: Relative URLs may be used. In this case the URL should be relative to the page which will be used to display the finished documents. For the images to be displayed correctly in the pages in which EditLive! for Java is embedded, the relative URL should also be the correct location relative to the pages in which EditLive! for Java is embedded.
Example
If the location of the display page directory is: http://myserver.com/editlivejava/somesite/site
The location of the directory where the images are stored is: http://myserver.com/editlivejava/somesite/site/images
The location of the directory containing the pages with EditLive! for Java embedded in them is: http://myserver.com/editlivejava/somesite/cms
Then the correct relative BASE URL location for both the viewing and editing pages to function correctly with images would be: ../site/images
We recommend using absolute URLs when possible, as it is less likely to lead to confusion.
Images are uploaded when the contents of EditLive! for Java are submitted. This occurs when the form which contains EditLive! for Java has its submit method called.
There are a number of problems that may occur while attempting to use HTTP Image Upload. These can be complicated and are chiefly to do with the settings on your server of choice.
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.