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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

%><br />

strReturnString = fileObj.EkFileSave(BinaryFormData, "uploadfilephoto", _<br />

Server.MapPath(ServerLocation), ErrorCode, "makeunique")<br />

<br />

Load Succeeded<br />

The file now exists at: /<br />

<br />

Load Failed with Error = <br />

Error Description = <br />

<br />

<br />

<br />

Conclusion<br />

ColdFusion<br />

Managing Images<br />

Now, the ASP page that activates the upload dynamically retrieves the destination<br />

from the dest_loc field.<br />

NOTE Regarding the destination location given for the upload: the path specified must<br />

be visible to IIS, either physically or virtually. If it is not, there is no access for<br />

uploads. This is why a path like "http://localhost" does not work.<br />

Security with ColdFusion<br />

From here the site must implement other options, such as file type checking,<br />

database updating, and any other required functionality.<br />

Macromedia/Allaire ColdFusion server has a CFFILE feature that enables you to<br />

save files to the server's file system. See the ColdFusion server documentation<br />

for details on CFFILE.<br />

The ColdFusion database sample supplied with <strong>eWebEditPro</strong> includes an action<br />

page (medianotification.cfm) and a custom tag file (ewebeditprouploadfile.cfm) to<br />

receive uploaded files. In it, you see the <br />

tag.<br />

The image selection page with the Browse button should validate the file<br />

extension to be uploaded. Security should also be in the ColdFusion page that is<br />

the form's action page. The ColdFusion page should check the file type and only<br />

accept files that are safe, such as image files with extensions: gif, jpg, or png. You<br />

may also want to allow document files, such as, doc and pdf extensions, or media<br />

files, like, wav, ram, and asf (see “Validext Element” on page 432).<br />

You should not allow CFM or HTML files to be uploaded; a malicious person could<br />

gain control over the Web server and cause damage.<br />

For best security, you should only allow authorized users to access a page with<br />

<strong>eWebEditPro</strong> on it. Most Web servers provide user authentication. Alternately,<br />

you could use FTP, which is protected with a password. If needed, you can<br />

disable Image Upload. The ColdFusion administrator can enable or disable the<br />

CFFILE tag.<br />

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

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

Saved successfully!

Ooh no, something went wrong!