Hello
I get the following error message when I try to upload images 'Attribute
validation error for tag CFFILE'. Im using ColdFusion on my local machine which
is a ppc mac. My database is MySQL and im building an online shop using a
Dreamweaver plug-in called Cartweaver. I have checked the file sizes are OK and
that they have the right extensions. Any other information goes onto the
database fine, its just the images which cause this problem. Just to be a bit
more specific, the admin access 'back end' of the site has a cms where you
browse for files locally and then upload. The error message the web page throws
up is:
An error occurred during the file upload process. This is likely due to one of
the reasons below:
The MIME type of the uploaded file was not accepted by the server. Please
verify that you are uploading a file of the appropriate type.
The folder specified for the image type doesn't exist on the server.
The application doesn't have the correct permissions on the server.
Now I know the MIME type of the images are OK, The folders specified do exist
and im pretty sure the application has the correct permissions. I changed the
permissions of the image folders and the site root folder by using the 'get
info' command.
This is where I think the problem may lie:
<cftry>
<cffile action="upload" filefield="file" destination="#DiskFolderPath#"
nameconflict="MakeUnique" accept="image/*">
<!--- Get the file name --->
<cfset fileName = cffile.clientFile>
<cfif fileName NEQ cffile.serverFile>
<cfset UploadError = "Duplicate">
<cfelse>
<cflocation url="#Request.Thispage#?result=The file #fileName# has been
successfully uploaded.&file=#fileName#&type=#imageType#" addtoken="no">
</cfif>
<!--- If the file upload failed --->
<cfcatch type="Any">
<cfset UploadError = "<p>An error occurred during the file upload
process. This is likely due to one of the reasons bel
Katsuey - 29 Jul 2007 03:59 GMT
You are going to probably have better luck asking on the Cartweaver
site. First, make sure you have the latest update (which I think is 3.06).
Next, have you tried loading the admin files to the server, and then going
to that area (on the internet) and uploading that way? Do you still get the
same error messages?
What format are your images in?
If it's a MAC issue - I know nothing about Mac.
jason skitterall - 29 Jul 2007 14:41 GMT
Hi Katsuey,
I have posted in the Cartweaver newsgroup too but I think this problem is more
specific to ColdFusion and that CFFILE tag. Im a bit of a newbie and had a
whole lot of problems setting up the database because I cant use MS SQL locally
on my mac. I managed to get everything running together MySQL,CF and Cartweaver
or so I thought!!
I have loaded my files from my local testing server and always get the same
error. I tried to update my CW from 3.0.6 to 3.0.7 and that wasnt sucessful
either as I got this error:
"Some errors occurred while attempting to update your database. These changes
should be made to your database manually.
? Error Executing Database Query.: ?NOT successfully executed
You should remove the /cw3/updates/ folder from your server."
This makes me think something is seriously wrong with my installation!
The images I tried to upload were both .jpg and .gif and of the correct file
size.
My database looks fine and any text goes in there great, just images that
dont. I understand the image file names get put on the database and the actual
files get stored in folders. I accessed these folders straight from my local
server and set the permissions to user and admin etc.
I dont really know what to do next, any ideas, suggestions or resources would
be a great help. For instance can I set up the CFFILE tag in ColdFusion if this
is the actual problem?
Jason
ogre11 - 30 Jul 2007 16:43 GMT
can you post the details of the error, or even the stack trace as well? The big
text will say attribute validation, but then underneath, the should be more
details about the error, specifically which attribute is wrong, or if you have
a bad combination of attributes.
jason skitterall - 31 Jul 2007 12:36 GMT
This is the complete report, as shown by my browser, I hope the answer is in
here somewhere:
Debugging Information
ColdFusion Server Developer 7,0,2,142559
Template /ourbeadshop/cw3/Admin/ProductImageUpload.cfm
Time Stamp 31-Jul-07 12:20 PM
Locale English (US)
User Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.5)
Gecko/20070713 Firefox/2.0.0.5
Remote IP 127.0.0.1
Host Name localhost
Execution Time
Total Time Avg Time Count Template
80 ms 80 ms 1 top level
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/ProductImageUpload.cfm
36 ms 36 ms 1
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/Application.cfm
35 ms 35 ms 1
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/Application.cfm
4 ms 4 ms 1
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/CWTags/CWTagGlobalSettings.
cfm
2 ms 2 ms 1
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/OnRequestEnd.cfm
1 ms 1 ms 1 /Applications/ColdFusionMX7/wwwroot/ourbeadshop/OnRequestEnd.cfm
0 ms 0 ms 1
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/CWTags/CWIncDiscountFunctio
ns.cfm
0 ms 0 ms 2
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/CWTags/CWIncFunctions.cfm
21 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
139 ms TOTAL EXECUTION TIME
red = over 250 ms average execution time
Exceptions
12:20:05.005 - Application Exception - in
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/ProductImageUpload.cfm
: line 75
Attribute validation error for tag CFFILE.
SQL Queries rsSelectedImageType (Datasource=dave, Time=2ms, Records=1) in
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/ProductImageUpload.cfm
@ 12:20:05.005
SELECT * FROM tbl_list_imagetypes
WHERE imgType_ID = ?
Query Parameter Value(s) -
Parameter #1(cf_sql_integer) = 1
rsAllImageTypes (Datasource=dave, Time=1ms, Records=4) in
/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/ProductImageUpload.cfm
@ 12:20:05.005
SELECT * FROM tbl_list_imagetypes
ORDER BY imgType_SortOrder, imgType_Name
Scope Variables
Application Variables:
allowbackorders=True
chargeshipbase=True
chargeshipby=Subtotal
chargeshipextension=True
chargetaxbasedon=Shipping
chargetaxonshipping=True
companyaddress1=123 Any St.
companyaddress2=
companycity=Sometown
companycountry=USA
companyemail=support@cartweaver.com
companyfax=
companyname=Cartweaver Demo Store
companyphone=555-555-1236
companystate=WA
companyzip=98765
continueshopping=Details
dbtype=MySQL
defaultcountryid=5
detailsdisplay=Advanced
developeremail=support@cartweaver.com
displaydiscountnotes=True
displaylineitemdiscount=True
displaylineitemtaxes=True
displaytaxid=False
displaytaxonproduct=True
enabledebugging=True
enablediscounts=True
enableerrorhandling=False
enableshipping=True
mailserver=localhost
numberofcolumns=2
optionsmenu=<a href="Options.cfm?optionID=2">–Color</a><a
href="Options.cfm?optionID=3">–Cut</a><a
href="Options.cfm?optionID=4">–Other</a><a
href="Options.cfm?optionID=1">–Size</a>
relatecategoriessecondaries=1
resultsperpage=4
shipcalctype=localcalc
shipstatusmenu=<a href="Orders.cfm?SearchBy=1">–Pending</a><a
href="Orders.cfm?SearchBy=2">–Verified</a><a
href="Orders.cfm?SearchBy=3">–Shipped</a><a
href="Orders.cfm?SearchBy=4">–Canceled</a><a
href="Orders.cfm?SearchBy=5">–Returned</a>
showapplication=True
showcgi=False
showclient=False
showcookie=False
showdebuglink=False
showform=False
showimageincart=True
showimagepopup=True
showlocal=False
showrequest=True
showserver=False
showsession=True
showupsell=True
showurl=False
siteroot=/ourbeadshop/
storepassword=jaso
taxidnumber=
taxsystem=General
versionnumber=3.0.6
CGI Variables:
AUTH_PASSWORD=
AUTH_TYPE=
AUTH_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_KEYSIZE=
CERT_SECRETKEYSIZE=
CERT_SERIALNUMBER=
CERT_SERVER_ISSUER=
CERT_SERVER_SUBJECT=
CERT_SUBJECT=
CF_TEMPLATE_PATH=/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/Produ
ctImageUpload.cfm
CONTENT_LENGTH=1215
CONTENT_TYPE=multipart/form-data;
boundary=---------------------------20072377098235644401115438165
CONTEXT_PATH=
GATEWAY_INTERFACE=
HTTPS=
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
HTTP_ACCEPT=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/
plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_ENCODING=gzip,deflate
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
HTTP_CONNECTION=keep-alive
HTTP_COOKIE=CFID=319;
CFCLIENT_REDELEPHANT=taxcountryid%3D5%23taxstateid%3D0%23cartid%3D2012787%23;
CFTOKEN=68856587;
CFGLOBALS=urltoken%3DCFID%23%3D319%26CFTOKEN%23%3D68856587%23lastvisit%3D%7Bts%2
0%272007%2D07%2D31%2012%3A19%3A38%27%7D%23timecreated%3D%7Bts%20%272007%2D07%2D2
7%2013%3A17%3A11%27%7D%23hitcount%3D170%23cftoken%3D68856587%23cfid%3D319%23;
JSESSIONID=58306cc24140ef529499
HTTP_HOST=localhost:8500
HTTP_REFERER=http://localhost:8500/ourbeadshop/cw3/Admin/ProductImageUpload.cfm?
type=1&nextpage=3
HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
PATH_INFO=
PATH_TRANSLATED=/Applications/ColdFusionMX7/wwwroot/ourbeadshop/cw3/Admin/Produc
tImageUpload.cfm
QUERY_STRING=
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=localhost
REMOTE_USER=
REQUEST_METHOD=POST
SCRIPT_NAME=/ourbeadshop/cw3/Admin/ProductImageUpload.cfm
SERVER_NAME=localhost
SERVER_PORT=8500
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=
WEB_SERVER_API=
Client Variables:
cartid=2012787
cfid=319
cftoken=68856587
hitcount=170
lastvisit={ts '2007-07-31 12:19:38'}
taxcountryid=5
taxstateid=0
timecreated={ts '2007-07-27 13:17:11'}
urltoken=CFID=319&CFTOKEN=68856587
Cookie Variables:
CFCLIENT_REDELEPHANT=taxcountryid=5#taxstateid=0#cartid=2012787#
CFGLOBALS=urltoken=CFID#=319&CFTOKEN#=68856587#lastvisit={ts '2007-07-31
12:19:38'}#timecreated={ts '2007-07-27
13:17:11'}#hitcount=170#cftoken=68856587#cfid=319#
CFID=319
CFTOKEN=68856587
JSESSIONID=58306cc24140ef529499
Form Fields:
ACTION=upload
FIELDNAMES=TYPE,FILE,SUBMIT,ACTION
FILE=/Applications/ColdFusionMX7/runtime/servers/coldfusion/SERVER-INF/temp/wwwr
oot-tmp/neotmp45629.tmp
SUBMIT=Upload Image
TYPE=1
Session Variables:
accesslevel=admin
availablediscounts=66
cfid=319
cftoken=68856587
currentdiscount=
cwdebuggeritems=Array (0)
debug=False
debugstatus=ON
lastlogin={ts '2007-07-31 09:12:47'}
loggedin=1
loggeduser=admin
promotionalcode=
sessionid=REDELEPHANT_319_68856587
urltoken=CFID=319&CFTOKEN=68856587
URL Parameters:
CART=
RESETAPPLICATION=
RESULT=
Debug Rendering Time: 114 ms