Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

com.oreilly.servlet cannot upload big files  RSS feed

 
christine lorraine
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i'm using oreilly's multipart class for my file uploads.
it is working well on my pc.. but when i tried my upload module on our production site an "Unexpected end of part" exception appears when the size of the file im uploading exceeds 100KB...
pls help.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason's multipart class has two different constructors, one that takes a size limit and one that doesn't. The default size limit is something like 100K or a Meg (I don't remember which). Is it possible you're using the constructor that doesn't take the size limit?
Otherwise, sounds like it might be a browser problem. Which browser version are you using?
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
christine lorraine
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. it worked...
 
varkala prabhakar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear christine,
I am also trying to upload a file to server but i get null value from the html page when i try to retrive the file name using getParameterValues("ss"). Would you tell me how you have retrived the file name .
thanx
prabhakar.
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you try
objMultipartRequest.getFileNames();
 
varkala prabhakar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx deep,
getFileNames(); worked out,
But now when i use req.getParameter("string") before MultipartRequest i get the null values, and in my program, i need one parameter to be retrived before multipartRequest.
req u to plz help me
thanx
prabhakar.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can retrieve the parameter from the multipart request object. If you 'need' the parameter before the file itself, for example, the parameter shows where to upload the file to, what you should do is upload to a temporary directory and retrieve the file path later, and then use the File i/o classes to move that file. This is the recommended behaviour if you read the cos faq.
 
varkala prabhakar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear mike,
thanx for answering me and atlast i did the same thing and it worked out.
thanx
prabhakar.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!