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.

ReceiveSubmittedFiles ' Saves the submitted files.<br />

Automatic Upload<br />

Response.Write("Client version is: " & g_iClientMajorRev & "." & g_iClientMinorRev &<br />

"")<br />

Response.Write("There were " & g_iFileCount & " files uploaded.")<br />

'''''''''''''''''''''''''''''''''''''''''''''''''<br />

' Call the routine to save the submitted files<br />

' to local locations.<br />

' This also processes the uploaded files and<br />

' generates the response data.<br />

Sub ReceiveSubmittedFiles()<br />

Dim BinaryFormData, uploadObj, fileObj, ServerLocation<br />

Dim strNewFileName, strFileLoc, ErrorCode, iFileIdx<br />

BinaryFormData = Request.BinaryRead(Request.TotalBytes)<br />

set uploadObj = CreateObject("eWepAutoSvr.EkFile")<br />

ServerLocation = "/images" ' Hard coded the location for this sample.<br />

strNewFileName = uploadObj.EkFileSave(BinaryFormData, "uploadfilephoto", _<br />

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

g_iFileCount = uploadObj.FileCount()<br />

If g_iFileCount > 0 then<br />

Do while iFileIdx < g_iFileCount<br />

iFileIdx = iFileIdx + 1<br />

Set fileObj = uploadObj.FileObject(iFileIdx)<br />

strNewFileName = fileObj.FileName()<br />

strFileLoc = "HTTP://" & Request.ServerVariables("SERVER_NAME") & ServerLocation &<br />

"/" & strNewFileName<br />

fileObj.FileUrl(strFileLoc)<br />

fileObj.Thumbnail(CreateThumbnail(strFileLoc))<br />

fileObj.Thumb<strong>Reference</strong>(ExtractThumbnailRef(strFileLoc))<br />

loop<br />

End Sub<br />

%><br />

'Retrieve global data<br />

g_strDataIslandID = uploadObj.ResponseID()<br />

g_iClientMajorRev = uploadObj.ClientMajorRev()<br />

g_iClientMinorRev = uploadObj.ClientMinorRev()<br />

Response.Write(uploadObj.ResponseData())<br />

End If<br />

0 Then %><br />

<br />

Uploaded File Information<br />

<br />

ThumbnailImage DisplayDescription of Image<br />

<br />

<br />

<br />

<br />

<br />

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

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

Saved successfully!

Ooh no, something went wrong!