15.08.2013 Views

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Media File Object<br />

gif,jpg,png,jpeg,jif<br />

<br />

Dynamically Selecting Upload Destinations<br />

The Media File Object is the interface to a selected file’s internet properties.<br />

Effective use of the Media File Object is the key to manipulating the upload<br />

mechanism. The object contains information on uploading, referencing, and<br />

displaying the file.<br />

To retrieve the interface to the object, using the MediaFile method.<br />

var objMedia =<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.MediaFile();<br />

or<br />

var objMedia =<br />

<strong>eWebEditPro</strong>.instances[sEditorName].editor.MediaFile();<br />

Use these Media File Object methods to affect upload information.<br />

getProperty(PropertyName as string, vData as Variant)<br />

getPropertyString(PropertyName as string) as Variant<br />

Use these properties to affect the upload mechanism, location, and reference.<br />

TransferMethod as String – Method of Upload<br />

DefDestinationDir as String – Upload path location<br />

(TransferRoot as String – alias for DefDestinationDir)<br />

WebRoot as String – Path reference from a Web page<br />

WebRoot only inherits the value of DefDestinationDir when it is not assigned<br />

a value anywhere, including in the configuration data. As a result, ASP, Cold<br />

Fusion, and other scripting that use the same domain and directory structure for<br />

transfers and referencing can work with the single DefDestinationDir<br />

property.<br />

See Also: ”Media File Object” on page 19<br />

Modifying the Upload Location<br />

Configuration Data<br />

Any customization should begin with the configuration data, since all default<br />

settings are defined there. In this case, the mediafiles section is the focus. The<br />

following example explains how to address these issues.<br />

• Since the example changes the upload mechanism programmatically, it<br />

defaults to the internal FTP setting.<br />

• The default upload destination directory is defined in the configuration file.<br />

• Since the Web reference path is the same as the destination, the example<br />

does not include a webroot element. As a result, the WebRoot property<br />

inherits the value defined in the xferdir element and any value assigned to<br />

the DefDestinationDir property.<br />

<strong>Ektron®</strong> <strong>eWebEditPro</strong> Developer’s <strong>Reference</strong> <strong>Guide</strong>, Release 5.1, Revision 1 451

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!