File Upload Problems
Hi, I was just looking at the struts-upload application... why is the file uploaded to %TOMCAT_HOME%/bin ? What i would like to do is to save the uploaded file in a subdirectory of the root of the application (%TOMCAT_HOME%/webapps/myapp/uploaddir). The saving location is determined on a the "file category" chosen in the file upload form. Another thing I don't know is, how I can retrieve the base path of my web application. I tried something like this: String savingLocation = new String( request.getContextPath() + "/data/" + category.getPath() + "/" + fileName); Then I create a File with this path as in: File tempFile = new File(savePath); If i read the absolute path of the tempFile: String absPath = tempFile.getAbsolutePath(); i get the following: C:\myapp\data\tests\uploadedFile.txt where - myapp is the name of the application - tests is the path name for this category supplied in the form - uploadedFile.txt is the uploaded file :-) Any tips, suggestions and examples would be highly appreciated. Thanks, Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: file upload problems
Ricky, That's interesting! I would like to try the "error page functionality" that you talked about. If you can give me some hints about how to use it, that would be greatly appreciated. I don't understand how you can pass the ServletException all the way up to the Error JSP without changing the existing struts code. (May be I should get the latest code!). I guess this will make more sense when I learn about the error page functionality. Thanks for your time. - Ajay -- Original Message -- >I am trying to accomplish the same thing but am taking a different >approach. I have not changed any Struts code, instead I am trying to use > >the error page functionality to handle the ServletException. I tried a >file upload with the same limitations as you mention below and did not have > >a problem with the browser continuing to upload. My problem, however, is > >that the error page is not being displayed. I can see in the trace that >it >is being called but then just as it should be displayed in the browser I > >get a RuntimeException: > >java.lang.RuntimeException: Bad request, no URL ! > at >com.sssw.shr.http.HttpRequestMessage.notifyBeginParsing(HttpRequestMessage.java:187) > at com.sssw.shr.mime.MimeParser.parse(MimeParser.java:104) > at com.sssw.srv.http.Client.getNextRequest(Client.java:334) > at com.sssw.srv.http.Client.loop(Client.java:1194) > at com.sssw.srv.http.Client.runConnection(Client.java:1421) > at com.sssw.srv.http.Client.run(Client.java:1381) > at java.lang.Thread.run(Thread.java:484) > >I then get a DNS server not found error in the browser. > >I believe that it has something to do with how Struts is forwarding control > >to the error page. I'm not sure but I think it might be because the >response was already "committed" by the time the forward is taking >place. I tried reconfiguring Struts to use a redirect instead of a forward > >but that didn't seem to help. Anyone have any ideas? > >Ricky > > > >At 12:04 PM 9/13/2001 -0700, you wrote: >>Hello, >> >>Does anybody know what I can do to resolve the following problem with the >>file upload? >> >>Summary of problem: >> >>When I try to upload a file larger than the maximum limit allowed, the >>"Maximum >>length exceeded" message doesn't appear on the screen until the entire file >>is uploaded. In other words, even though the server throws >>MaxLengthExceededException >>right away, the browser keeps processing the file. I can't figure out a >>way to cancel the processing so that the message is displayed right away! >> >>This happens within "Struts Framework" as well as outside Struts framework. >> >> >> >> >>Detail Description: >> >>To see how Struts handles file uploading here's what I am doing; >> >>1) One of the business requirement for my project is that the user is not >>allowed to attach files larger than a certain limit. >>2) To catch this condition I added 'maxFileSize' to web.xml (as described >>in the attached email). >>3) This is when I started getting MaxLengthExceededException and Internal >>Server Error (as described in the attached email). >>4) To resolve this "temporarily", I decided to "play around" with the struts >>code, so I changed the code to pass the 'MaxLengthExceededException' all >>the way up to the ActionServlet. I changed the following methods; >> >>MultipartIterator Constructor >>DiskMultipartRequestHanlder.handleRequest() >>RequestUtils.populate() >>ActionServlet.processPopulate() >>ActionServlet.process() >> >>5) This works really well for files of small size. But when I set the >>maxFileSize to 1Meg and try to upload a 30Meg file the server throws the >>MaxLengthExceededException right away, but the browser keeps processing >>the 30Meg file. The "Maximum file limit exceeded" message doesn't show >>up for about 10 minutes - until the browser is finished processing the file. >> Is there a way to cancel browser processing right away? >> >>Thanks for your time. >> >>- Ajay >> >> >> > >> >-Original Message- >> >From: Ajay Chitre [mailto:[EMAIL PROTECTED]] >> >Sent: Monday, September 10, 2001 11:56 PM >> >To: [EMAIL PROTECTED] >> >Subject: RE: file upload problems >> > >> > >> >Mike, >> > >> >I tried setting the maxFileSize as follows; >> > >> > >>
RE: file upload problems
I am trying to accomplish the same thing but am taking a different approach. I have not changed any Struts code, instead I am trying to use the error page functionality to handle the ServletException. I tried a file upload with the same limitations as you mention below and did not have a problem with the browser continuing to upload. My problem, however, is that the error page is not being displayed. I can see in the trace that it is being called but then just as it should be displayed in the browser I get a RuntimeException: java.lang.RuntimeException: Bad request, no URL ! at com.sssw.shr.http.HttpRequestMessage.notifyBeginParsing(HttpRequestMessage.java:187) at com.sssw.shr.mime.MimeParser.parse(MimeParser.java:104) at com.sssw.srv.http.Client.getNextRequest(Client.java:334) at com.sssw.srv.http.Client.loop(Client.java:1194) at com.sssw.srv.http.Client.runConnection(Client.java:1421) at com.sssw.srv.http.Client.run(Client.java:1381) at java.lang.Thread.run(Thread.java:484) I then get a DNS server not found error in the browser. I believe that it has something to do with how Struts is forwarding control to the error page. I'm not sure but I think it might be because the response was already "committed" by the time the forward is taking place. I tried reconfiguring Struts to use a redirect instead of a forward but that didn't seem to help. Anyone have any ideas? Ricky At 12:04 PM 9/13/2001 -0700, you wrote: >Hello, > >Does anybody know what I can do to resolve the following problem with the >file upload? > >Summary of problem: > >When I try to upload a file larger than the maximum limit allowed, the >"Maximum >length exceeded" message doesn't appear on the screen until the entire file >is uploaded. In other words, even though the server throws >MaxLengthExceededException >right away, the browser keeps processing the file. I can't figure out a >way to cancel the processing so that the message is displayed right away! > >This happens within "Struts Framework" as well as outside Struts framework. > > > > >Detail Description: > >To see how Struts handles file uploading here's what I am doing; > >1) One of the business requirement for my project is that the user is not >allowed to attach files larger than a certain limit. >2) To catch this condition I added 'maxFileSize' to web.xml (as described >in the attached email). >3) This is when I started getting MaxLengthExceededException and Internal >Server Error (as described in the attached email). >4) To resolve this "temporarily", I decided to "play around" with the struts >code, so I changed the code to pass the 'MaxLengthExceededException' all >the way up to the ActionServlet. I changed the following methods; > >MultipartIterator Constructor >DiskMultipartRequestHanlder.handleRequest() >RequestUtils.populate() >ActionServlet.processPopulate() >ActionServlet.process() > >5) This works really well for files of small size. But when I set the >maxFileSize to 1Meg and try to upload a 30Meg file the server throws the >MaxLengthExceededException right away, but the browser keeps processing >the 30Meg file. The "Maximum file limit exceeded" message doesn't show >up for about 10 minutes - until the browser is finished processing the file. > Is there a way to cancel browser processing right away? > >Thanks for your time. > >- Ajay > > > > > >-Original Message- > >From: Ajay Chitre [mailto:[EMAIL PROTECTED]] > >Sent: Monday, September 10, 2001 11:56 PM > >To: [EMAIL PROTECTED] > >Subject: RE: file upload problems > > > > > >Mike, > > > >I tried setting the maxFileSize as follows; > > > > > > maxFileSize > > 100K > > > > > >This throws a MaxLengthExceededException as expected. I would like to >catch > >this exception and show a user friendly message on the screen. How can >I > >do > >that? Please help > > > > > >Here's what I am doing; > > > >1) I unzipped the struts-upload.war file that came with Struts 1.0. (I > >believe you wrote this sample app - thanks!) > >2) In the web.xml I made the changes shown above. > >3) I ran this app in Weblogic 5.1 (sp 9) and Tomcat 3.2.3. In both cases, > >when I submit a file larger than 100K I get > >a MaxLengthExceededException and I get Error 500 - Internal Server Error > >on > >the screen. > > > > > >Here's my understanding of the problem - Please ignore this if it doesn't > >make sense...
RE: file upload problems
Hello, Does anybody know what I can do to resolve the following problem with the file upload? Summary of problem: When I try to upload a file larger than the maximum limit allowed, the "Maximum length exceeded" message doesn't appear on the screen until the entire file is uploaded. In other words, even though the server throws MaxLengthExceededException right away, the browser keeps processing the file. I can't figure out a way to cancel the processing so that the message is displayed right away! This happens within "Struts Framework" as well as outside Struts framework. Detail Description: To see how Struts handles file uploading here's what I am doing; 1) One of the business requirement for my project is that the user is not allowed to attach files larger than a certain limit. 2) To catch this condition I added 'maxFileSize' to web.xml (as described in the attached email). 3) This is when I started getting MaxLengthExceededException and Internal Server Error (as described in the attached email). 4) To resolve this "temporarily", I decided to "play around" with the struts code, so I changed the code to pass the 'MaxLengthExceededException' all the way up to the ActionServlet. I changed the following methods; MultipartIterator Constructor DiskMultipartRequestHanlder.handleRequest() RequestUtils.populate() ActionServlet.processPopulate() ActionServlet.process() 5) This works really well for files of small size. But when I set the maxFileSize to 1Meg and try to upload a 30Meg file the server throws the MaxLengthExceededException right away, but the browser keeps processing the 30Meg file. The "Maximum file limit exceeded" message doesn't show up for about 10 minutes - until the browser is finished processing the file. Is there a way to cancel browser processing right away? Thanks for your time. - Ajay > >-Original Message- >From: Ajay Chitre [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 11:56 PM >To: [EMAIL PROTECTED] >Subject: RE: file upload problems > > >Mike, > >I tried setting the maxFileSize as follows; > > > maxFileSize > 100K > > >This throws a MaxLengthExceededException as expected. I would like to catch >this exception and show a user friendly message on the screen. How can I >do >that? Please help > > >Here's what I am doing; > >1) I unzipped the struts-upload.war file that came with Struts 1.0. (I >believe you wrote this sample app - thanks!) >2) In the web.xml I made the changes shown above. >3) I ran this app in Weblogic 5.1 (sp 9) and Tomcat 3.2.3. In both cases, >when I submit a file larger than 100K I get >a MaxLengthExceededException and I get Error 500 - Internal Server Error >on >the screen. > > >Here's my understanding of the problem - Please ignore this if it doesn't >make sense... > >This exception is thrown in the BufferedMultipartInputStream constructor. >Shouldn't this exception be passed all the way up to the >ActionServlet.processPopulate()? This method has access to the >'formInstance' which can be used to notify the user. Does this make sense? > >Anyway, any help in this matter will be greatly appreciated. Thanks. > >- Ajay > > > >-Original Message- >From: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 10:18 AM >To: '[EMAIL PROTECTED]' >Subject: RE: file upload problems > > >Ricky, > >The maximum upload size is represented as an init-param for ActionServlet: > >To set it as an init-param in web.xml: > > >action >org.apache.struts.action.ActionServlet > > maxFileSize > 100K > >2 > > >The value of "maxFileSize" can be represented as in bytes by not appending >any >characters to the end, kilobytes by appending a "K" at the end, megabytes >by >appending an "M" at the end, and gigabytes by appending a "G" at the end. > >Example: > >100 bytes: > >action >org.apache.struts.action.ActionServlet > > maxFileSize > 100 > >2 > > >100 kilobytes: > > >action >org.apache.struts.action.ActionServlet > > maxFileSize > 100K > >2 > > >100 Megabytes: > > >action >org.apache.struts.action.ActionServlet > > maxFileSize > 100M > >2 > > >100 Gigabytes > >action >org.apache.struts.action.ActionServlet > > maxFileSize > 100G > >2 > > > > >-Original Message- &
RE: file upload problems
Mike, >From your email id I am guessing that you are based in New Jersey. I cannot tell you how sorry I am to hear about what happened today in New York. I am really hoping that this hasn't affected your family directly. Indirectly this has affected all of us. Nice people like you who spare their free time to help out other needy people (like me) and who donate their work to the open source community should never experience anything like this. But life isn't always fair. Quite a few nice people (such as Firemen & Policemen) lost their lives today. I can only hope that the people who caused this will be punished - SEVERELY! I live in California. Other than offering my best wishes, there's nothing else I can do at this time. I feel fairly useless. Even though I don't know you personally, you and your family will be in my prayers tonight. Take care of yourself & your family. - Ajay -Original Message- From: Ajay Chitre [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 11:56 PM To: [EMAIL PROTECTED] Subject: RE: file upload problems Mike, I tried setting the maxFileSize as follows; maxFileSize 100K This throws a MaxLengthExceededException as expected. I would like to catch this exception and show a user friendly message on the screen. How can I do that? Please help Here's what I am doing; 1) I unzipped the struts-upload.war file that came with Struts 1.0. (I believe you wrote this sample app - thanks!) 2) In the web.xml I made the changes shown above. 3) I ran this app in Weblogic 5.1 (sp 9) and Tomcat 3.2.3. In both cases, when I submit a file larger than 100K I get a MaxLengthExceededException and I get Error 500 - Internal Server Error on the screen. Here's my understanding of the problem - Please ignore this if it doesn't make sense... This exception is thrown in the BufferedMultipartInputStream constructor. Shouldn't this exception be passed all the way up to the ActionServlet.processPopulate()? This method has access to the 'formInstance' which can be used to notify the user. Does this make sense? Anyway, any help in this matter will be greatly appreciated. Thanks. - Ajay -Original Message- From: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 10:18 AM To: '[EMAIL PROTECTED]' Subject: RE: file upload problems Ricky, The maximum upload size is represented as an init-param for ActionServlet: To set it as an init-param in web.xml: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 The value of "maxFileSize" can be represented as in bytes by not appending any characters to the end, kilobytes by appending a "K" at the end, megabytes by appending an "M" at the end, and gigabytes by appending a "G" at the end. Example: 100 bytes: action org.apache.struts.action.ActionServlet maxFileSize 100 2 100 kilobytes: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 100 Megabytes: action org.apache.struts.action.ActionServlet maxFileSize 100M 2 100 Gigabytes action org.apache.struts.action.ActionServlet maxFileSize 100G 2 -Original Message- From: Ricky Frank [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: RE: file upload problems Can you also provide an example of the tag for limiting the size of the file uploaded? Or is this not supported? I've dug through some of the underlying code and it looks like it is but I don't see anything in the tag definition on how to invoke this limitation. Thanks. Ricky Frank At 12:10 PM 9/10/2001 -0400, you wrote: >Rightfully Disgruntled File Upload Users, > >I'll set aside some time next week to address >all the file upload issues, I apologize for the >long delay. > >In the interim, please use bug reports >(http://nagoya.apache.org/bugzilla/) >to report all file upload issues that you >come across. Check to see if it's reported, >if not, go ahead and do so. This notifies >me directly. > > >-Original Message- >From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 9:59 AM >To: [EMAIL PROTECTED] >Subject: file upload mangling files > > >Hi. What's the status on fixing the file upload problem of files getting >mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This >is very important to us. Tom Tibbetts _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: file upload problems
I have the exact same problem and am looking for the same answer At 11:55 PM 9/10/2001 -0700, you wrote: >Mike, > >I tried setting the maxFileSize as follows; > > > maxFileSize > 100K > > >This throws a MaxLengthExceededException as expected. I would like to catch >this exception and show a user friendly message on the screen. How can I do >that? Please help > > >Here's what I am doing; > >1) I unzipped the struts-upload.war file that came with Struts 1.0. (I >believe you wrote this sample app - thanks!) >2) In the web.xml I made the changes shown above. >3) I ran this app in Weblogic 5.1 (sp 9) and Tomcat 3.2.3. In both cases, >when I submit a file larger than 100K I get >a MaxLengthExceededException and I get Error 500 - Internal Server Error on >the screen. > > >Here's my understanding of the problem - Please ignore this if it doesn't >make sense... > >This exception is thrown in the BufferedMultipartInputStream constructor. >Shouldn't this exception be passed all the way up to the >ActionServlet.processPopulate()? This method has access to the >'formInstance' which can be used to notify the user. Does this make sense? > >Anyway, any help in this matter will be greatly appreciated. Thanks. > >- Ajay > > > >-Original Message- >From: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 10:18 AM >To: '[EMAIL PROTECTED]' >Subject: RE: file upload problems > > >Ricky, > >The maximum upload size is represented as an init-param for ActionServlet: > >To set it as an init-param in web.xml: > > > action > org.apache.struts.action.ActionServlet > > maxFileSize > 100K > > 2 > > >The value of "maxFileSize" can be represented as in bytes by not appending >any >characters to the end, kilobytes by appending a "K" at the end, megabytes by >appending an "M" at the end, and gigabytes by appending a "G" at the end. > >Example: > >100 bytes: > > action > org.apache.struts.action.ActionServlet > > maxFileSize > 100 > > 2 > > >100 kilobytes: > > > action > org.apache.struts.action.ActionServlet > > maxFileSize > 100K > > 2 > > >100 Megabytes: > > > action > org.apache.struts.action.ActionServlet > > maxFileSize > 100M > > 2 > > >100 Gigabytes > > action > org.apache.struts.action.ActionServlet > > maxFileSize > 100G > > 2 > > > > >-Original Message- >From: Ricky Frank [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 12:29 PM >To: [EMAIL PROTECTED] >Subject: RE: file upload problems > > >Can you also provide an example of the tag for limiting the size of the >file uploaded? Or is this not supported? I've dug through some of the >underlying code and it looks like it is but I don't see anything in the tag >definition on how to invoke this limitation. Thanks. Ricky Frank > >At 12:10 PM 9/10/2001 -0400, you wrote: > >Rightfully Disgruntled File Upload Users, > > > >I'll set aside some time next week to address > >all the file upload issues, I apologize for the > >long delay. > > > >In the interim, please use bug reports > >(http://nagoya.apache.org/bugzilla/) > >to report all file upload issues that you > >come across. Check to see if it's reported, > >if not, go ahead and do so. This notifies > >me directly. > > > > > >-Original Message- > >From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] > >Sent: Monday, September 10, 2001 9:59 AM > >To: [EMAIL PROTECTED] > >Subject: file upload mangling files > > > > > >Hi. What's the status on fixing the file upload problem of files getting > >mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This > >is very important to us. Tom Tibbetts > > >_ >Do You Yahoo!? >Get your free @yahoo.com address at http://mail.yahoo.com _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: file upload problems
Mike, I tried setting the maxFileSize as follows; maxFileSize 100K This throws a MaxLengthExceededException as expected. I would like to catch this exception and show a user friendly message on the screen. How can I do that? Please help Here's what I am doing; 1) I unzipped the struts-upload.war file that came with Struts 1.0. (I believe you wrote this sample app - thanks!) 2) In the web.xml I made the changes shown above. 3) I ran this app in Weblogic 5.1 (sp 9) and Tomcat 3.2.3. In both cases, when I submit a file larger than 100K I get a MaxLengthExceededException and I get Error 500 - Internal Server Error on the screen. Here's my understanding of the problem - Please ignore this if it doesn't make sense... This exception is thrown in the BufferedMultipartInputStream constructor. Shouldn't this exception be passed all the way up to the ActionServlet.processPopulate()? This method has access to the 'formInstance' which can be used to notify the user. Does this make sense? Anyway, any help in this matter will be greatly appreciated. Thanks. - Ajay -Original Message- From: SCHACHTER,MICHAEL (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 10:18 AM To: '[EMAIL PROTECTED]' Subject: RE: file upload problems Ricky, The maximum upload size is represented as an init-param for ActionServlet: To set it as an init-param in web.xml: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 The value of "maxFileSize" can be represented as in bytes by not appending any characters to the end, kilobytes by appending a "K" at the end, megabytes by appending an "M" at the end, and gigabytes by appending a "G" at the end. Example: 100 bytes: action org.apache.struts.action.ActionServlet maxFileSize 100 2 100 kilobytes: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 100 Megabytes: action org.apache.struts.action.ActionServlet maxFileSize 100M 2 100 Gigabytes action org.apache.struts.action.ActionServlet maxFileSize 100G 2 -Original Message- From: Ricky Frank [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: RE: file upload problems Can you also provide an example of the tag for limiting the size of the file uploaded? Or is this not supported? I've dug through some of the underlying code and it looks like it is but I don't see anything in the tag definition on how to invoke this limitation. Thanks. Ricky Frank At 12:10 PM 9/10/2001 -0400, you wrote: >Rightfully Disgruntled File Upload Users, > >I'll set aside some time next week to address >all the file upload issues, I apologize for the >long delay. > >In the interim, please use bug reports >(http://nagoya.apache.org/bugzilla/) >to report all file upload issues that you >come across. Check to see if it's reported, >if not, go ahead and do so. This notifies >me directly. > > >-Original Message- >From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 9:59 AM >To: [EMAIL PROTECTED] >Subject: file upload mangling files > > >Hi. What's the status on fixing the file upload problem of files getting >mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This >is very important to us. Tom Tibbetts _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: file upload problems
Ricky, The maximum upload size is represented as an init-param for ActionServlet: To set it as an init-param in web.xml: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 The value of "maxFileSize" can be represented as in bytes by not appending any characters to the end, kilobytes by appending a "K" at the end, megabytes by appending an "M" at the end, and gigabytes by appending a "G" at the end. Example: 100 bytes: action org.apache.struts.action.ActionServlet maxFileSize 100 2 100 kilobytes: action org.apache.struts.action.ActionServlet maxFileSize 100K 2 100 Megabytes: action org.apache.struts.action.ActionServlet maxFileSize 100M 2 100 Gigabytes action org.apache.struts.action.ActionServlet maxFileSize 100G 2 -Original Message- From: Ricky Frank [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: RE: file upload problems Can you also provide an example of the tag for limiting the size of the file uploaded? Or is this not supported? I've dug through some of the underlying code and it looks like it is but I don't see anything in the tag definition on how to invoke this limitation. Thanks. Ricky Frank At 12:10 PM 9/10/2001 -0400, you wrote: >Rightfully Disgruntled File Upload Users, > >I'll set aside some time next week to address >all the file upload issues, I apologize for the >long delay. > >In the interim, please use bug reports >(http://nagoya.apache.org/bugzilla/) >to report all file upload issues that you >come across. Check to see if it's reported, >if not, go ahead and do so. This notifies >me directly. > > >-Original Message- >From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 9:59 AM >To: [EMAIL PROTECTED] >Subject: file upload mangling files > > >Hi. What's the status on fixing the file upload problem of files getting >mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This >is very important to us. Tom Tibbetts _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: file upload problems
Can you also provide an example of the tag for limiting the size of the file uploaded? Or is this not supported? I've dug through some of the underlying code and it looks like it is but I don't see anything in the tag definition on how to invoke this limitation. Thanks. Ricky Frank At 12:10 PM 9/10/2001 -0400, you wrote: >Rightfully Disgruntled File Upload Users, > >I'll set aside some time next week to address >all the file upload issues, I apologize for the >long delay. > >In the interim, please use bug reports >(http://nagoya.apache.org/bugzilla/) >to report all file upload issues that you >come across. Check to see if it's reported, >if not, go ahead and do so. This notifies >me directly. > > >-Original Message- >From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 10, 2001 9:59 AM >To: [EMAIL PROTECTED] >Subject: file upload mangling files > > >Hi. What's the status on fixing the file upload problem of files getting >mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This >is very important to us. Tom Tibbetts _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: file upload problems
Rightfully Disgruntled File Upload Users, I'll set aside some time next week to address all the file upload issues, I apologize for the long delay. In the interim, please use bug reports (http://nagoya.apache.org/bugzilla/) to report all file upload issues that you come across. Check to see if it's reported, if not, go ahead and do so. This notifies me directly. -Original Message- From: Tom Tibbetts [mailto:[EMAIL PROTECTED]] Sent: Monday, September 10, 2001 9:59 AM To: [EMAIL PROTECTED] Subject: file upload mangling files Hi. What's the status on fixing the file upload problem of files getting mangled? I use Struts ver 1.0. Is there a fix available??? Thanks, This is very important to us. Tom Tibbetts
RE: More File upload problems
> -Original Message- > From: Azariah Jeyakumar > Sent: Tuesday, May 01, 2001 2:32 PM > To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' > Subject: More File upload problems > > Hi, > > I have found three more problems with file upload using the > nightly build (20010430): > > 1. File upload does not work (see exception stack trace > below) with IE 5.0 but works with IE 5.5, Netscape 4.76, Netscape 6. This problem happens only when I upload .txt files from IE 5.0. The exception does not happen when I upload other binary files such as .p7c extension from IE 5.0. Thanks Azariah > 2. Cleanup of temp files on empty upload > If I submit the form without choosing the file to > upload, the tmp file does not get cleaned up. I have checked > that I am calling FormFile.destroy() > 3. temp dir is not taken from javax.servlet.context.tempDir > I am using resin and it correctly sets the attribute > javax.servlet.context.tempDir to the directory > ...\WEB-INF\tmp. But the ActionServlet continues to have the > tempDir property as null. When I explicitly create the > directory (whose path is returned in the File object in the > javax.servlet.context.tempDir attribute) and then set its > path in ActionServlet, then the upload correctly happens in > this directory. > > Thanks > Azariah > > 500 Servlet Exception > javax.servlet.ServletException: MultipartIterator: no > multipart request data sent > at > org.apache.struts.upload.MultipartIterator.parseRequest(Multip > artIterator.java:337) > at > org.apache.struts.upload.MultipartIterator.(MultipartIte > rator.java:152) > at > org.apache.struts.upload.DiskMultipartRequestHandler.handleReq > uest(DiskMultipartRequestHandler.java:59) > at > org.apache.struts.util.RequestUtils.populate(RequestUtils.java:454) > at > org.apache.struts.action.ActionServlet.processPopulate(ActionS > ervlet.java:2020) > at > org.apache.struts.action.ActionServlet.process(ActionServlet.j > ava:1535) > at > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:489) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:102) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) > at > com.caucho.server.http.Invocation.service(Invocation.java:291) > at > com.caucho.server.http.CacheInvocation.service(CacheInvocation > .java:121) > at > com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:238) > at > com.caucho.server.http.HttpRequest.handleConnection(HttpReques > t.java:157) > at com.caucho.server.TcpConnection.run(TcpConnection.java:140) > at java.lang.Thread.run(Thread.java:484) > >
More File upload problems
Hi, I have found three more problems with file upload using the nightly build (20010430): 1. File upload does not work (see exception stack trace below) with IE 5.0 but works with IE 5.5, Netscape 4.76, Netscape 6. 2. Cleanup of temp files on empty upload If I submit the form without choosing the file to upload, the tmp file does not get cleaned up. I have checked that I am calling FormFile.destroy() 3. temp dir is not taken from javax.servlet.context.tempDir I am using resin and it correctly sets the attribute javax.servlet.context.tempDir to the directory ...\WEB-INF\tmp. But the ActionServlet continues to have the tempDir property as null. When I explicitly create the directory (whose path is returned in the File object in the javax.servlet.context.tempDir attribute) and then set its path in ActionServlet, then the upload correctly happens in this directory. Thanks Azariah 500 Servlet Exception javax.servlet.ServletException: MultipartIterator: no multipart request data sent at org.apache.struts.upload.MultipartIterator.parseRequest(MultipartIterator.ja va:337) at org.apache.struts.upload.MultipartIterator.(MultipartIterator.java:152 ) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:59) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:454) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20 20) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1535) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:489) at javax.servlet.http.HttpServlet.service(HttpServlet.java:102) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:238) at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
RE: File upload problems
Hi, I am picking up on an old thread. > The first problem you reported might be fixed as of recent builds, > please try a nightly build and let me know if it works. I tried last night's build (20010430) and I could not reproduce the file-upload problem that I was facing. > As for the multibox issue, I'll definately look into it this week. I noticed that this problem also has been fixed, Thanks. Thanks Azariah * From: Schachter, Michael * Subject: RE: File upload problems * Date: Mon, 23 Apr 2001 17:03:36 -0700 Azariah, The first problem you reported might be fixed as of recent builds, please try a nightly build and let me know if it works. As for the multibox issue, I'll definately look into it this week. Thank you -Original Message- From: Azariah Jeyakumar [<mailto:[EMAIL PROTECTED]>] Sent: Monday, April 23, 2001 6:11 PM To: '[EMAIL PROTECTED]' Cc: Martin Cooper Subject: File upload problems Hi, We are using the file upload feature of struts heavily. We face the foll problems: 1. I get "java.io.IOException: end of stream before boundary found!" intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I submit the form that contains File upload. I have not been able to identify a pattern when this exception happens. But I think the exception happens only when no file is actually entered/uploaded. To elaborate, my form has several Submit buttons. Only 1 of the submit button expects the type=file field to have a valid file name. All other submit buttons dont care about the field. When I click on one of these other submit buttons, I get the above exception, intermittently. 2. The tag struts:multibox does not work well in a form that has enctype=multipart/form-data. Only the last checkbox that I selected is set in the multibox form field. I expect a comma separated list of the value of all the selected checkboxes. This works in the form if I remove the enctype attribute. We use jakarta-struts-1.0-b1. Thanks Azariah Full stack trace for first problem: 500 Servlet Exception java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
RE: File upload problems
Azariah, The first problem you reported might be fixed as of recent builds, please try a nightly build and let me know if it works. As for the multibox issue, I'll definately look into it this week. Thank you -Original Message- From: Azariah Jeyakumar [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 6:11 PM To: '[EMAIL PROTECTED]' Cc: Martin Cooper Subject: File upload problems Hi, We are using the file upload feature of struts heavily. We face the foll problems: 1. I get "java.io.IOException: end of stream before boundary found!" intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I submit the form that contains File upload. I have not been able to identify a pattern when this exception happens. But I think the exception happens only when no file is actually entered/uploaded. To elaborate, my form has several Submit buttons. Only 1 of the submit button expects the type=file field to have a valid file name. All other submit buttons dont care about the field. When I click on one of these other submit buttons, I get the above exception, intermittently. 2. The tag struts:multibox does not work well in a form that has enctype=multipart/form-data. Only the last checkbox that I selected is set in the multibox form field. I expect a comma separated list of the value of all the selected checkboxes. This works in the form if I remove the enctype attribute. We use jakarta-struts-1.0-b1. Thanks Azariah Full stack trace for first problem: 500 Servlet Exception java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
File upload problems
Hi, We are using the file upload feature of struts heavily. We face the foll problems: 1. I get "java.io.IOException: end of stream before boundary found!" intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I submit the form that contains File upload. I have not been able to identify a pattern when this exception happens. But I think the exception happens only when no file is actually entered/uploaded. To elaborate, my form has several Submit buttons. Only 1 of the submit button expects the type=file field to have a valid file name. All other submit buttons dont care about the field. When I click on one of these other submit buttons, I get the above exception, intermittently. 2. The tag struts:multibox does not work well in a form that has enctype=multipart/form-data. Only the last checkbox that I selected is set in the multibox form field. I expect a comma separated list of the value of all the selected checkboxes. This works in the form if I remove the enctype attribute. We use jakarta-struts-1.0-b1. Thanks Azariah Full stack trace for first problem: 500 Servlet Exception java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) at com.caucho.server.http.Invocation.service(Invocation.java:291) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
Handling file upload problems on Netscape
I use DiskMultiPartRequestHandler to handle file uploads. When I upload a file on Netscape Communicator 4.77, for some reason some of the bytes are dropped. The same file uploads fine on Netscape 6.0 and IE. Foo.ear, for example, is 63818 bytes on NC 4.77 while it's actual size of 64754 bytes is maintained while uploading on Netscape 6.0 and IE. Different files have different deltas. Has anyone seen anything like this ? Any ideas ? Thanx in advance. Cheers, Prasad Kashyap 254-6161