Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
| Search | Today's Posts | Mark Forums Read
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2006, 01:12 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default File strorage handling using JSP

hi....

well let said I have lots of incoming file for user and other server, is there any code example show how to allocate and handle those file like storing to another hard dirve partition?

Thanks


 
Old July 22nd, 2006, 09:36 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should implement a servlet to do this, rather than a JSP. Assuming the POSTs received are multipart/form-data, you should use a library to parse out the file data. I recommend Apache Commons FileUpload (http://jakarta.apache.org/commons/fileupload/). When you receive a request, pass it to FileUpload for parsing, then get an InputStream for the file data. Read from the InputStream and write to a FileOutputStream on the hard drive.

Jon Emerson
http://www.jonemerson.net/
 
Old July 23rd, 2006, 02:05 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

btw, is it possible to perform file distribution among server using JSP?

 
Old July 24th, 2006, 02:44 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

JSP is an HTML/XML view and templating technology. It's not quite right to say it's capable of the back-end things you're asking about. If you mean to ask whether Java can do this with servlets, of course it can.

Jon Emerson
http://www.jonemerson.net/
 
Old July 30th, 2006, 12:44 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank for reply..........

I'm trying to make a web server to "communicate" with another server........
do you have any tutorial or source code?


Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
here is my code c++ file handling amahja56 C++ Programming 2 November 23rd, 2007 07:25 AM
File handling vijayma VB How-To 3 June 7th, 2006 01:30 AM
FILE HANDLING yojeiram_n1 C++ Programming 2 March 13th, 2006 02:57 PM
c++ file handling. amahja56 C++ Programming 2 March 23rd, 2005 07:13 PM
FILE HANDLING sanchita ADO.NET 8 November 8th, 2004 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.