
January 28th, 2005, 03:19 PM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 84
Time spent in forums: 19 h 50 m 45 sec
Reputation Power: 5
|
|
|
Uploading Images using WAP and Coldfusion from camera phone
I am trying to make a photo gallery to allow people to upload images from there camera phone to a photo gallery system on a website, so far I have been able to update the database with the information, but I have been unable to upload the image using the cffile tag.
wap_image_upload.cfm
Code:
<cfcontent type="text/vnd.wap.wml">
<wml>
<card title="Upload Image">
<p>Name:<input type="text" name="name" size="15"/></p>
<p>Image: <input type="file" name="phone_image"/></p>
<p>Caption:<input type="text" name="caption" size="15"/></p>
<do type="accept" label="Upload">
<go href="post_image.cfm" method="post" ENCTYPE="multipart/form-data"/>
<postfield name="name" value="$(name)"/>
<postfield name="phone_image" value="$(phone_image)"/>
<postfield name="caption" value="$(caption)"/>
</do>
</card>
</wml>
post_image.cfm
Code:
<cfcontent type="text/vnd.wap.wml">
<wml>
<card>
<cffile action="upload" filefield="phone_image" destination="#ExpandPath('..\images\cell_gallery\')#" nameconflict="makeunique">
<cfset new_photo1 = '#File.ServerFile#'>
<cfset nyear = #Year(Now())#>
<cfset nmonth = #Month(Now())#>
<cfset nday = #Day(Now())#>
<cfset ndate = #CreateDate(nyear, nmonth, nday)#>
<cfquery name="NewOne" datasource="photos">
INSERT into public_images
(CatID, thumb_image, caption, ndate, submiteed_by, Approved) values
(12, '#new_photo1#', '#caption#', #ndate#, '#name#', 0)
</cfquery>
Thank you: <cfoutput>#name#</cfoutput>
Your image has been uploaded.
</card>
</wml>
when I try to load the post_image.cfm I get a 500 error message.
Any Suggestions
|