tag:blogger.com,1999:blog-36773632.post8497864998532184360..comments2023-12-19T08:40:05.062-05:00Comments on Java Evangelist John Yeary: Servlet 3.0 and HTML 5 File Upload Servlet ExampleJohn Yearyhttp://www.blogger.com/profile/00461192445071361043noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-36773632.post-73838101306618992572012-11-07T21:08:53.541-05:002012-11-07T21:08:53.541-05:00Thanks for adding information @Unekwu which is mor...Thanks for adding information @Unekwu which is more clarifying.John Yearyhttps://www.blogger.com/profile/00461192445071361043noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-3035301149513456782012-11-07T21:07:54.871-05:002012-11-07T21:07:54.871-05:00The code for uploading depends on the browser for ...The code for uploading depends on the browser for uploads. Some allow multiple uploads, and some don't.<br /><br />For some examples of file uploaders see my other posts.<br /><br />http://javaevangelist.blogspot.com/2011/12/multiple-file-upload-examples.html<br /><br />http://javaevangelist.blogspot.com/2010/12/multiple-file-upload-options.htmlJohn Yearyhttps://www.blogger.com/profile/00461192445071361043noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-8107758912529497312012-11-07T18:42:49.519-05:002012-11-07T18:42:49.519-05:00@Kim From John's code, all the files are sent ...@Kim From John's code, all the files are sent to the server at the same time and processed in the loop. So every file found in the multipart object is written to the server.<br /><br />Also you can write individual files by doing <br />Part multipartfile = request.getPart("filename");<br />multipartfile.write(new File("/interesting/location/file"))Unekwuhttps://www.blogger.com/profile/03970579982568123485noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-52136028795348920992012-11-06T18:06:06.882-05:002012-11-06T18:06:06.882-05:00sorry not to be more specific in my question.
if ...sorry not to be more specific in my question.<br /><br />if there're 2 files in the form to be uploaded, will this line:<br /><br /> for (Part part : request.getParts()) ...<br /><br />get hit right after the first part comes to server of after both files have already landed/transfered to the webserver ?<br /><br />thanx.Anonymoushttps://www.blogger.com/profile/04857971968322968782noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-11460222309986645102012-11-05T20:05:08.975-05:002012-11-05T20:05:08.975-05:00I have not tried it on any large files. There are ...I have not tried it on any large files. There are usually practical limits to uploading files using an HTML uploader. If you have some large files to upload, I would be interested in seeing what difficulties if any that you encounter. <br /><br />The example was not meant to be a complete solution. It was a simple demonstration of what is possible.John Yearyhttps://www.blogger.com/profile/00461192445071361043noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-8986249935682215972012-11-05T18:43:37.734-05:002012-11-05T18:43:37.734-05:00i wonder in case when the big files are uploaded,...i wonder in case when the big files are uploaded, will the parts be available when all the content is parsed & saved/cache somewhere by the jvm or or they streamed ?<br /><br />thanx Anonymoushttps://www.blogger.com/profile/04857971968322968782noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-29819488802865785282012-11-01T07:00:30.137-05:002012-11-01T07:00:30.137-05:00You are correct sir! I am using a Mac. Thanks for ...You are correct sir! I am using a Mac. Thanks for the additional information for Windows users.John Yearyhttps://www.blogger.com/profile/00461192445071361043noreply@blogger.comtag:blogger.com,1999:blog-36773632.post-37816820781251426622012-11-01T02:53:51.244-05:002012-11-01T02:53:51.244-05:00Nice example. According path used in example, you ...Nice example. According path used in example, you are on unix based machine(Mac?) or linux. i am using win7 and i have sligthly changed code<br />@MultipartConfig(location="C:/temp")<br />works fine, except it breaks cyrylic filenames but it is a encoding issue.<br />thanksleminghttps://www.blogger.com/profile/02101944540006829975noreply@blogger.com