Rank: Newbie
Groups: Member
Joined: 10/12/2010(UTC) Posts: 8
|
Thanks for the response. I've got the front end working fine with the Javascript... it's the actionUrl that I'm having a tough time writing because I don't quite understand how everything should work in ColdFusion. Here's my current JS model: Code:<script type="text/javascript" src="ClientScripts/aurigma.imageuploaderflash.js"> </script>
<script type="text/javascript">
var fu = $au.imageUploaderFlash({
id: 'Uploader1',
width: '650px',
height: '480px',
licenseKey: 'REMOVED FOR THIS POST',
flashControl: {
codeBase: 'ClientScripts/aurigma.imageuploaderflash.swf'
},
converters: [
{mode: '*.*=Thumbnail', thumbnailFitMode: 'Fit', thumbnailWidth: '1200', thumbnailHeight: '1200', thumbnailJpegQuality: '60'},
{mode: '*.*=Thumbnail', thumbnailFitMode: 'Fit', thumbnailWidth: '90', thumbnailHeight: '68', thumbnailJpegQuality: '60'}
],
upload: {
actionUrl: 'photoengineupload-v3.cfm?h=#session.d2#',
redirectUrl: 'edit.cfm?step=2&status=1&mid=15&genre1=#genre1#&d=#session.d2#&RequestTimeout=9999'
}
});
fu.restrictions({
fileFilters: [
['Images (*.jpg; *.jpeg; *.jpe)', '*.jpg;*.jpeg;*.jpe']
],
minFileCount: 1,
maxFileCount: #val(photosallowed)#,
maxFileSize: 15728640, //15 MB in bytes
minImageWidth: 150,
minImageHeight: 150
});
fu.messages({
tooFewFilesError: 'You must select at least one file.',
tooManyFilesError: 'You can select not more than #val(photosallowed)# files.',
fileTooLargeError: 'You can add files not larger than 15 MB.',
imageHeightTooSmallError: 'Image height should be larger than 150 pixels.',
imageWidthTooSmallError: 'Image width should be larger than 150 pixels.'
});
fu.writeHtml();
</script>
With the old Java/ActiveX uploader, my actionURL page looks like this (and works great): Code:<cfprocessingdirective pageencoding="utf-8">
<cfset absLargePath="#DRIVEPATH#photos_test\tempupload\#trim(h)#_large\" />
<cfset absThumbnailsPath="#DRIVEPATH#photos_test\tempupload\#trim(h)#_thumbs\" />
<cfset descriptions=XmlParse("<files />") />
<cfset totalUploadedFileSize=0>
<cfloop index="i" from="1" to="#Form.FileCount#">
<cftry>
<!---Get the first thumbnail and save it to disk. It stores 1200x1200 optimized image.--->
<cffile action="UPLOAD" filefield="Thumbnail1_#i#"
destination="#absLargePath#"
nameconflict="MakeUnique">
<cfset fileName="#serverFile#">
<cfset totalUploadedFileSize = totalUploadedFileSize + #fileSize#>
<!---Get the second thumbnail and save it to disk. It stores 120x120 preview image.--->
<cffile action="UPLOAD" filefield="Thumbnail2_#i#"
destination="#absThumbnailsPath#"
nameconflict="MakeUnique">
<!---Rename thumbnail file so that it has .jpg extension--->
<cffile action="rename"
source="#absThumbnailsPath#/#serverFile#"
destination="#absThumbnailsPath#/#filename#">
<!---Save file info.--->
<cfset xmlFile=XmlElemNew(descriptions, "file") />
<cfset xmlFile.XmlAttributes.name=fileName />
<cfset xmlFile.XmlAttributes.width=evaluate("Form.Width_#i#") />
<cfset xmlFile.XmlAttributes.height=evaluate("Form.Height_#i#") />
<cfset xmlFile.XmlAttributes.description=evaluate("Form.Description_#i#") />
<cfset ArrayAppend(descriptions.files.XmlChildren, xmlFile) />
<cfcatch><cfthrow message="There was a problem uploading your file, please try again."></cfcatch>
</cftry>
</cfloop>
<cfset descriptions.files.XmlAttributes.totalUploadedFileSize=Int(totalUploadedFileSize / 1024) />
Thanks again for your help! Sincerely, Ray Edited by moderator Sunday, November 7, 2010 9:26:47 PM(UTC)
| Reason: Not specified
|