开发者

how to upload all of the contents in a folder from jsp

i'm trying to upload all of the contents in a folder to another folder in my server using jsp and servlets. I already got one FileUpload but as you may know i can only choose a single file. Is there some possible way to do this?? To be able to choose a folder instead of a single file f开发者_运维问答rom a jsp?

Thanks in advance


First thing you need to realize is that JSP is just a Java based view technology which allows you to control the output of HTML/CSS/JS using Java. After all, it's just HTML/CSS/JS which ends up in the webbrowser. In HTML, there's no possibility to select a folder for upload. The HTML <input type="file"> simply isn't designed for that. JSP can't do much about it.

Your best bet is creating a Java applet utilizing JFileChooser which is set to folder selection. You can embed it in the JSP page the usual HTML way. There are several 3rd party applets available which you could just download/buy and embed it in the JSP, but unfortunately none of them is freeware.

  • MyUploader
  • Rad Upload
  • HTTP File Upload Applet
  • JavaPowUpload
  • JFileUpload
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜