Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Content Type For File Upload  RSS feed

 
Meng Tan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What is the normally used content type for a file upload.
I am trying to send a file from a client program to a servlet but I dont know which content type to use. The file may be a text or a binary file.
Thanks.
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try application/octet-stream. It would
not include any assumptions about which
applications should execute which processes on the
data in transit. It would protect the binary types
and should not interfere with text at all.
HTH,
Joe
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally you would want to use the ENCTYPE attribute of the FORM element. You can search this or the JSP forum for more info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!