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.
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\"
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.
ASKER
I changed the code to:
<cffile action="upload" destination="#expandPath(' .')#\ssl\G BT\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."
<cffile action="upload" destination="#expandPath('
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."
ASKER
Anyone got any ideas? I've been googling around and trying every approach I can see but none work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow, totally weird; I changed nothing and it spontaneously works now....guess i wont ask questions.
<cffile action="upload"
destination="#expandPath('
filefield="attachment"
nameconflict="makeunique">
use expandPath('.') to build an absolute path to your root, append additional path info to the directory you want.
-tb55