Hi,

 Good and complete example is here:

http://www.roseindia.net/struts/strutsfileupload.shtml

and check this too:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=next_topic&f=58&t=006647&go=older

At the end of the day, you need to code Java I/O for file (s) manipulation.
If you read the 1st link, then can use this piece of code for saving file.

***********************************************
   public void saveFile(InputStream in, File dst)throws IOException {

           // dst: is a destination variable; where u r going to write file
which is lready created on server.
            // in: is an inputStream of the source file that is, file from
where u will copy the contents to dst. InputStream will be open on clients
file on his machine.

            OutputStream out = new FileOutputStream(dst);

            // Transfer bytes from in to out
            byte[] buf = new byte[1024];
            int len;
            while ((len = in.read(buf)) > 0) {
                System.out.println("writing to file and len = "+ len);
                out.write(buf, 0, len);
            }
            in.close();
            out.close();
        }

***********************************************

Hope it helps.

Bye,
Viki.


On 1/19/06, Niall Pemberton <[EMAIL PROTECTED]> wrote:
>
> http://wiki.apache.org/struts/StrutsFileUpload
>
> Niall
>
> ----- Original Message -----
> From: "David Thielen" <[EMAIL PROTECTED]>
> Sent: Thursday, January 19, 2006 1:32 AM
>
>
> > Hi;
> >
> > Is the best way to do this still FormFile and anyone have a url to a
> > good/correct example? (I've written tons of enterprise level java code,
> but
> > never a file upload or browse button.)
> >
> > Thanks - dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to