Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with MultipartFormDataRequest

 
Ajay Anand
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using MultipartFormDataRequest to upload files to my server. My problem is one day it works and another day it doesnt. Despite the code being same, MultipartFormDataRequest works inconsistently. There are no script or jsp errors. Can anyone help me?? I have pasted the code below. Please help its urgent . Thanks. Both the code snippets are from the same jsp file
Here the multipart code snippet


and here is the form for uploading the files

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What upload package are you using and why is there code in a JSP? Move the code to a servlet.
 
Ajay Anand
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using oreilly's servlet package(cos.jar)
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't make heads or tails of that. Is there anything in the logs?

Why do you sleep for two seconds for no apparent reason in the middle?
 
Nishikant Nipane
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:I can't make heads or tails of that. Is there anything in the logs?

Why do you sleep for two seconds for no apparent reason in the middle?


Why are not you try to make unique directory for every file name ? Will help in removing confusion as well. Please code as much in servlet as compared to jsp. What exactly happens when you submit the page?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic