EditLive! 9 Documentation : uploadImages Method

This method uploads any local images within the instance of EditLive! to the Web server. Upon calling this method the URLs for local images within the applet will be changed to point to the copies on the Web server instead of the local copies.

Prior to version 8.0 this function was asynchronous. The callback notification mechanism is still supported, however since version 8.0 this function can now be used synchronously.

Syntax

JavaScript
editliveInstance.uploadImages();

Parameters

jsFunct

This parameter is optional.

The JavaScript function which is called after all local images have been uploaded.

Example

The following code allows the user to force an upload of the images in EditLive! to the Web server. The uploadImages method is called by clicking on a button within the form.

<HTML>
   <HEAD>
      <TITLE>EditLive! JavaScript Example</TITLE>
      <!--Include the EditLive! JavaScript Library-->
      <SCRIPT src="editlivejava/editlivejava.js" language="JavaScript"></SCRIPT>
   </HEAD>
   <BODY>
      <FORM name = exampleForm>
         <P>
            <INPUT type="button"
               name="button1"
               value="Upload Images"
               onClick="editlivejs.uploadImages();" >
         </P>
         <!--Create an instance of EditLive!-->
         <SCRIPT language="JavaScript">
            var editlivejs = new EditLiveJava("editlive",450 , 275);
            editlivejs.setConfigurationFile("sample_elconfig.xml");
            editlivejs.setDocument(encodeURI("<p>Some initial text</p>"));
            editlivejs.show();
         </SCRIPT>
      </FORM>
   </BODY>
</HTML> 

Remarks

The uploadImages method should be called prior to using the GetBody or GetDocument load-time properties to retrieve the contents of the EditLive! applet.

The uploadImages method need not be called if the contents of EditLive! are processed through a server-side script using a HTTP Post. For more information on using HTTP Posts to retrieve EditLive! content, see the Retrieving Content From EditLive! article.

The upload script used by this method is the script specified in the EditLive! configuration file through the <httpUploadData> element.

See Also