Link to home
Start Free TrialLog in
Avatar of andrewaiello
andrewaiello

asked on

Problem with CFFILE upload

Hey All,

     I am encountering a weird problem with CFFILE.   On a page I have a form with a file type field called attachment:

 <input type="file" name="attachment">

And on the page that handles the post data I have the following code:

<cffile action="upload" destination="D:\Websites\www.jkingsweb.com\ssl\GBT\ProAct\" filefield="attachment" nameconflict="makeunique">


When this goes to execute it throws the following error:

 Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "D:\Websites\www.jkingsweb.com\ssl\GBT\ProAct\", is invalid.


I can't understand why this doesn't work as I have virtually the identical code on several other pages involving the same server and it works fine.  I've read that this error sometimes mysteriously pops up and some strange workarounds; but not have worked for me.  Anyone have any idea?  Thanks.
Avatar of trailblazzyr55
trailblazzyr55

have you tried doing this?

<cffile action="upload"
        destination="#expandPath('.')#\ssl\GBT\ProAct\"
        filefield="attachment"
        nameconflict="makeunique">

use expandPath('.') to build an absolute path to your root, append additional path info to the directory you want.

-tb55
Avatar of andrewaiello

ASKER

I changed the code to:

<cffile action="upload" destination="#expandPath('.')#\ssl\GBT\ProAct\" filefield="attachment" nameconflict="makeunique">

as you suggested and got the same error:

" Attribute validation error for tag CFFILE.
The value of the attribute destination, which is currently "D:\Websites\www.jkingsweb.com\ssl\GBT\ProAct\ssl\GBT\ProAct\", is invalid."
Anyone got any ideas?  I've been googling around and trying every approach I can see but none work.  
ASKER CERTIFIED SOLUTION
Avatar of trailblazzyr55
trailblazzyr55

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow, totally weird;  I changed nothing and it spontaneously works now....guess i wont ask questions.