Frank Sommers
Posts: 2642
Nickname: fsommers
Registered: Jan, 2002
|
|
Re: download servlet
|
Posted: Feb 25, 2002 12:30 AM
|
|
Ravi,
You mean a servlet to faciliate file upload (as specified in RFC 1867)? I don't have one handy here, but, if I'm correct, Jason Hunter's book on Java servlets has an example of this (http://www.servlets.com).
In general, the multipart MIME type indicates that the input stream is delimited by some special marker (which is typically assigned randomly by the browser). So, what you want to do is to read the input stream, pick out each instance of this special delimiter, and then everything in-between those delimiters will be parts of the form data. If you uploaded a binary file this way, then one of those sections will contain the encoded representation of the file's content; that will be preceded by the file name (local to the browser). Anyway, you might want to look up the RFC for the gory details....
Frank
|
|