Hi Peter,
When you start the upload process with web container will store the file in
a temp location. This will vary depending on your setup. The important thing
is that you can access as shown below and then write to a location of your
choosing. This code snippet is an edited version of that found in the upload
example app.
Note file is the DiskFile object..
-------------------------
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FileOutputStream fs = new FileOutputStream (<file name to save to>);
InputStream stream = file.getInputStream();
byte[] buffer = new byte[file.getFileSize()];
stream.read(buffer);
fs.write(buffer);
fs.close();
baos.write(buffer);
Hope this helps,
Jon
-----Original Message-----
From: Peter Giannopoulos [mailto:[EMAIL PROTECTED]]
Sent: 04 June 2001 02:35
To: [EMAIL PROTECTED]
Subject: Confused about Uploading
Hi all,
I am using the struts-upload.war example to upload
files. Everything sorta seems fine except I can't find
the files that I uploaded....
Where are they? How can I specify where I want the
permanently saved?
Better yet, are there any examples of how to store
them in a Db ?
Thanks a million,
Peter.
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/