The Artima Developer Community
Sponsored Link

Java Answers Forum
download servlet

2 replies on 1 page. Most recent reply: Feb 25, 2002 2:28 PM by Alain Ravet

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic    
Flat View: This topic has 2 replies on 1 page
ravi

Posts: 1
Nickname: loner
Registered: Feb, 2002

download servlet Posted: Feb 24, 2002 8:44 PM
Reply to this message Reply
Advertisement
hi all ...

can anybody send a simple download servlet code?
this is a bit urgent please.

-loner


Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: download servlet Posted: Feb 25, 2002 12:30 AM
Reply to this message Reply
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

Alain Ravet

Posts: 19
Nickname: aravet
Registered: Feb, 2002

Re: download servlet Posted: Feb 25, 2002 2:28 PM
Reply to this message Reply
Google is your friend : http://www.google.com/search?sourceid=navclient&q=servlet+upload+example

=>http://www.servlets.com/jservlet2/examples/ch04/index.html#ex04_21
=> http://www.servlets.com/jservlet2/examples/ch04/UploadTest.java

Flat View: This topic has 2 replies on 1 page
Topic: sorting arrays Previous Topic    

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use