Results 1 to 6 of 6

Thread: JFileUpload SocketException

  1. #1
    Join Date
    May 2011
    Posts
    55

    JFileUpload SocketException

    Hello Tech champs, hope you all re fine and doing well in your particular fields. I am here with one small exception that I need to solve it with the help of you all people. I have an exception in uploading the file to the server. Note that I can do it if the file is less than 1000 bytes and am not able to do if they are larger than 1000 bytes. The error is java.net.SocketException. The post method is being used but it is failing to send any of the data if the file size is large than 1000 bytes. So can anyone help me to solve this error?

  2. #2
    Join Date
    May 2009
    Posts
    527

    Re: JFileUpload SocketException

    I totally do not know what to reply on this kind of posts, but let’s try some trial and error solving so that me may succeed in solving your error. According to me it will read just 0 or more lines and your next line may not be in the buffer, which is the most of the4 cases in this kind of errors, so check your code and see whether you succeed in getting the nest line into the buffer before it leaves your loop, this may solve your uploading issue. I don’t guaranty that this is the solution for your question.

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    Re: JFileUpload SocketException

    Hello my brother, I also had the same problem once and I also was pulling my hairs out for getting it solved. It uses to upload some amount of file and would show error if the file size got increased. You should know that uploading takes a specific amount of time to do so. And uploading fails if either of the sockets closes the connection. Every socket is opened for specific period of time and closes after that time interval. So just increase your socket timing so that it remains open for some longer period of time and you can upload your files easily.

  4. #4
    Join Date
    May 2009
    Posts
    539

    Re: JFileUpload SocketException

    You need to change the maxRequestLength along with executionTimeout. I think you have an error occurring because of this two things only. Increase their number and try it out, it can solve your error. You will find this in httpRuntime tag. I was also working on the same thing and this error brought me the night mares then one of my pals just help me out and it was as simple as anything. You should try out the same.

  5. #5
    Join Date
    Apr 2009
    Posts
    569

    Re: JFileUpload SocketException

    Example of the httpRuntime tag example is:
    <httpRuntime
    executionTimeout = "61900"
    maxRequestLength = "2000000"
    requestLengthDiskThreshold = "6000"
    />
    Note: you will fing the runtime tag in web.config and the number in the example are the random numbers.

  6. #6
    Join Date
    May 2009
    Posts
    529

    Re: JFileUpload SocketException

    Here is the solution for your post. You have to make changes in the following things, first is the chunk size set it to 268435456. This will help you in uploading upto 256MB of file. But you can also upload up to 2GB of data. Working of JFileUpload, It splits the main file into chunks which are temporary in nature, then each chunk is being uploaded and finally temporary chunks are being deleted. After all this happens we will need a server side script, this Is for handling HTTP parameters.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,538,393.01837 seconds with 16 queries