• 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:

struts, where files are uploaded ??

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I tried the struts-upload,
1)but I don't know where the files are uploaded ?
2)how can I upload to a database ?
thanks, your help is appreciated.
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The files are going to be uploaded to wherever you tell them to be uploaded

If your doing the "bare minimum" my guess is they are going to end up in the root directory of your application.

if you look at this thread:
https://coderanch.com/t/50781/Struts/File-upload-struts
I have a snippet of code that writes a file to particular directory (defined by variables, so you can make it whatever directory you want, creating it if necessary).

If you want to store the file in a database, I'm not entirely sure how to do that, something I wouldn't mind knowing (especially if it were abstract enough to apply to any database that suppors binary fields?).

my guess would be to do something like:



-Tad
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I read the link, it does not show how to set the directory you want to upload your files to.

And the action code does not too :



Please any help is appreciated.
thanks
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



well the above has worked for me.
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code struts-upload that I have is different to what are you saying in the code snipet.
??
thanks
 
Goodbye moon men. Hello tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic