Copy link to clipboard
Copied
I am running the code below, but get the error "Invalid content type: application/x-www-form-urlencoded." I don't know what this is telling me and how I can get the code to work. It has worked in the past, but seems not to work now.
<CFFILE destination="#WritingSamplesInDirectory#"
action="upload"
nameconflict="MakeUnique"
filefield="FileName"
attribues="readONLY">
Any help greatly appreciated
1 Correct answer
You need to change your form's encoding to "multipart/form-data":
<form ... enctype="multipart/form-data">
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
You need to change your form's encoding to "multipart/form-data":
<form ... enctype="multipart/form-data">
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
Thanks, karolus
Copy link to clipboard
Copied
There are three types of encoding format. 1. application/x-www-form-urlencoded This is the default encoding format among HTTP requests. 2. multipart/form-data 3. text/plain For file upload , you have specify the enctype attribute of the form tag should be multipart/form-data .

