Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE - Upload

Status
Not open for further replies.

phile

Programmer
Apr 20, 2001
14
0
0
GB
I am having a problem uploading images using CFFILE on a win2k server. I can upload to one directory fine, but others give me an error 'Acess Denied (error5)'. I have checked that permissions are set correctly on all dirs and have even rebooted the server but I still get the error, can anyone give me any pointers as to what the problem is?

TIA

Phil.
 
Hey Phil,

Do the directories have the exact same permissions or are there any differences? Also, do I understand you correctly in that the application only fails when you change the directory?

GJ
 
Be sure that web sharing is turned on and that you give permition for script execution on the access permision. You should also check the IIS settings to see if you have the right settings there. You should have an application name associated with your main site directory and have scripts and executables on the permissions drop down.

Hope this helps.
 
Thanks guys, I found the problem. Very suprised CF error was not more specific. Access denied made me look into permissions, could not understand why I could upload to /images/ but not to /images/background/ when the sub dir propogates permissions from parent. Anyway this was the problem...

<cfparam name=&quot;image_path&quot; default=&quot;&quot;>

<cfswitch expression=&quot;#form.image_type#&quot;>
<cfcase value=&quot;button&quot;><cfset image_path = &quot;buttons&quot;></cfcase>
<cfcase value=&quot;background&quot;><cfset image_path = &quot;background&quot;></cfcase>
</cfswitch>


<cffile action=&quot;UPLOAD&quot;
filefield=&quot;image_file&quot;
destination=&quot;#request.server_path#\images\#image_path#&quot;
nameconflict=&quot;SKIP&quot;
accept=&quot;image/gif, image/pjpeg&quot;>

As you can see, no backslashes on path when dir is buttons or background. Doh!!!

Phil.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top