Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

struts, where files are uploaded ??

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator



well the above has worked for me.
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code struts-upload that I have is different to what are you saying in the code snipet.
??
thanks
 
Does this tiny ad smell okay to you?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic