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.

Automatic Upload<br />

strCommand = g_objUpload.EkFormFieldValue(g_binaryFormData, "actiontyp", ErrorCode)<br />

' These are the possible commands:<br />

If strCommand = "uploadfile" Then<br />

ReceiveSubmittedFiles ' Saves the submitted files.<br />

ElseIf strCommand = "uploadcontent" Then<br />

ReceiveContent<br />

Else<br />

Response.Write("Unknown Posting.")<br />

End If<br />

End Sub<br />

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

' This function will receive the files and send back<br />

' the required response data. There is no processing<br />

' of the files and there is no affecting the file data.<br />

Sub ReceiveSubmittedFiles()<br />

Dim objFile, iErrorCode<br />

Dim strLogicalRefDest, strFileAltTitle, strReqWebRoot, strImageDate<br />

Dim iFileSize, iExtensionID, iWidth, iHeight, strFileType<br />

strLogicalRefDest = g_objUpload.EkFormFieldValue(g_binaryFormData, "editor_media_path",<br />

iErrorCode)<br />

strFileAltTitle = g_objUpload.EkFormFieldValue(g_binaryFormData, "file_title", iErrorCode)<br />

strReqWebRoot = g_objUpload.EkFormFieldValue(g_binaryFormData, "web_media_path",<br />

iErrorCode)<br />

strImageDate = g_objUpload.EkFormFieldValue(g_binaryFormData, "img_date", iErrorCode)<br />

iFileSize = g_objUpload.EkFormFieldValue(g_binaryFormData, "file_size", iErrorCode)<br />

iExtensionID = g_objUpload.EkFormFieldValue(g_binaryFormData, "extension_id", iErrorCode)<br />

iWidth = g_objUpload.EkFormFieldValue(g_binaryFormData, "width", iErrorCode)<br />

iHeight = g_objUpload.EkFormFieldValue(g_binaryFormData, "height", iErrorCode)<br />

strFileType = g_objUpload.EkFormFieldValue(g_binaryFormData, "file_type", iErrorCode)<br />

strNewFileName = g_objUpload.EkFileSave(g_binaryFormData, "uploadfilephoto", _<br />

Server.MapPath(strLogicalRefDest), iErrorCode, "makeunique")<br />

If g_objUpload.FileCount() > 0 then<br />

Set objFile = g_objUpload.FileObject(1)<br />

strNewFileName = objFile.FileName()<br />

objFile.FileUrl(MakeMediaPathName(strReqWebRoot, strNewFileName)) ' see:<br />

functions.asp<br />

AddFileToDatabase strFileAltTitle, strReqWebRoot, strNewFileName, strImageDate,<br />

iFileSize, iExtensionID, iWidth, iHeight<br />

Set objFile = Nothing<br />

End If<br />

End Sub<br />

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

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

' This routine processes the submission of the<br />

' content contained within the <strong>eWebEditPro</strong> editor.<br />

Sub ReceiveContent()<br />

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

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

Saved successfully!

Ooh no, something went wrong!