• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

File upload in struts

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I am trying to upload a file in struts,

In my action form I have


In the action class



At this point I am stuck, I need to store the file on the hard disk.
Can some one give me a few hints or a code snippet.

Thanks in advance for all the help
Achal
[ March 29, 2005: Message edited by: Achal Jalan ]
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Since you know how to get the byte array contening the raw data, the usual way to write a file should apply.

Let's suppose you're working in the root directory of C:\ and you want to create a file called "uploadedData.dat" from the array you called fileData :

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
rather than struggling with all these try 2 download jar and tld web page[blue]make ur self free from burden ok.[/blue] make use of all uri i mean tag lib's they will give full demostartion with war file .
if still struggling let me know [email protected]
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Location is the FormFile and fmf.getDir() is the directory I want to put it in (from the the action form).

-Tad

Hope that helps you.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic