Enctype in Form

Why do we use enctype in form while uploading a file?

Questions by mukulb22

Showing Answers 1 - 9 of 9 Answers

skumar.t15

  • Aug 5th, 2010
 

The enctype attribute specifies how form-data should be encoded before sending it to the server. It will take by default enctype is "application/x-www-form-urlencoded". It means all characters are encoded before they are sent to the server (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values).

At file uploadation time you should be mention enctype as "multipart/form-data". Otherwise selected file path will treated as a normal text then it can follow normal text encoding method(same as above). When you use enctype as "multipart/form-data" it will encode located file data not path/location (No characters are encoded).

You can refer some more details about enctype at
http://www.w3schools.com/tags/att_form_enctype.asp

K.Muthuvel5

  • Aug 18th, 2010
 

The enctype attribute specifies how form-data should be encoded before sending it to the server.The form-data is encoded to "application/x-www-form-urlencoded" by default. This means that all characters are encoded before they are sent to the server (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values).

  Was this answer useful?  Yes

abc

  • Sep 12th, 2011
 

The enctype attribute specifies how form-data should be encoded before sending it to the server.The form-data is encoded to "application/x-www-form-urlencoded" by default.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions