Skip to main content
Known Participant
February 13, 2011
Answered

Problem: Invalid content type: application/x-www-form-urlencoded.

  • February 13, 2011
  • 2 replies
  • 9915 views

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

    This topic has been closed for replies.
    Correct answer Dave Watts

    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/

    2 replies

    gym_prathap
    Participant
    October 6, 2012

    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 .

    HTML Training

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    February 14, 2011

    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/

    Dave Watts, Eidolon LLC
    KarolusAuthor
    Known Participant
    February 19, 2011

    Thanks, karolus