• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Upload Multiple Files or Folder

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a requirement of uploading multiple files or A folder from the client side to the Server's Specific location.
How to achieve the same.


can anybody help me.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you are using struts, you can make use of the struts upload action. If it is plain vanilla JSP. make use of the <file> tag in html, and read the file manually in your java controller class.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know it is not possible to upload several files or a complete folder in one turn via HTTP to the server.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dawn, unless someone specifically mentions Struts or posts in the Struts forum, please do not assume that Struts is in use. Thanks.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is most often accomplished by presenting multiple file upload controls to the user. You can even use JavaScript to create as many as you want on demand.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at Apache Commons FileUpload .
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I am using Apaches common upload API only, But in my application there is a requirement user needs to upload some 100 files
At one shot.There i am not able to incorporate the Apache commons upload technique to select a Folder containing 100 files.

How to Do it ?
Any Solution will be highly appreciated.
 
Frank Eichfelder
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this case, you can use an applet for selecting a folder on the client side, but you would have to code the tranfer of the individual files to the server yourself (commons-fileupload handles only the server-side of file-transfer as far as I know).
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do any Body have any sample to proceed forward.

if any Body have please give as soon as possible.
Thanks in Adv.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to use an applet I'd suggest to look into the Apache Commons HttpClient library. The http://faq.javaranch.com/java/FileUpload page links to some material about both libraries.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanxs for the link
http://faq.javaranch.com/java/FileUpload

but it is same as i am using i am using apachec commons only.
But with using browse button to upload files
i cant able to upload Folders .

So, i want help,how can i use an applet at the client side which will communicate with apache commons API
to upload Files.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this has become about Applets. I've shifted it to the Applets forum.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abinash das wrote:i cant able to upload Folders .


That's why it was suggested that you write an applet that lets the user select a folder. Then you can use the Commons HttpClient library for the applet (client) side of the upload.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I am new To Appelts,So If Some Body have a sample Code of an Applet which Uploads Folder
and is Integrated with the Apache Commons will be really Help full.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An extensive applet tutorial can be found at http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

Before you go down that road, make sure that using applets is acceptable with regards to requirements and user base.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic