• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

upload folder in jsp

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

Can any one please tell me how to upload folde in java.
If we use input type is file it is taking only file but my
requirement is to select folder.

thanks in advance.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can't upload folder directly.
but one thing you can do
first of all convert (compress) that folder into zip file using java code and then upload that.

 
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot directly upload a folder, either you have to manually zip the folder and upload it or you have to use java to zip your folder. for more information

see here
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

anusha chaitanya wrote: for more information

see here



It is important to note that this code has to be run on the client side, it probably won't help ram krishnaa!
 
chaitanya karthikk
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Lorand Komaromi, for remembering me that the code must be run on server side and not on client side.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ram krishnaa wrote:but my
requirement is to select folder.



You can achieve that with a client side application, a signed java applet or a flash application, you'll find exaples here or here!
 
chaitanya karthikk
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Lorand Komaromi, I will definitely check it, thanks for correcting me.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

anusha chaitanya wrote:Thank you Lorand Komaromi, I will definitely check it, thanks for correcting me.



Np!
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The upload functionality (the file input element) in current browsers does not support this. Therefore it is not possible with a serverside techology.

You can not even try to automate it with DHTML autofilled file input fields either since the element is write protected for obvious security reasons.

You would need more than a little clientside (Java) coding to accomplish something like that.

I'd recommend teaching users to zip their folders (which is easy with a right click on Win) and then upload them. You could then automate the unzipping process of the folder(s) on the server.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic