JFileUpload SocketException

I am not sure whether this is the right place to ask this but I figured that maybe someone here has used JFileUpload for uploading files to a server.

I just downloaded the applet and tested it out on my server and uploading works as long as the files are smaller that 1,000 bytes, i.e. very small images. Whenever I try with a larger file I get the error:

When I look at the request sent to my server, I see that it is using a POST method but it is not sending any data, whereas with the smaller images I can see the data being sent. I think there might be a limitation for the file size in the applet but I couldn't see anything in the applet_http.js file. Also, I think I might be reading the browser request in a wrong way. Here's how I do it:

Returns: True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.

As far as I can see that means that it will return false when you have read zero or more lines but the next line is not yet in the buffer - which is quite likely over a web link. So you will exit your read loop as soon as you catch up with the input, not when the input is complete. You need a better way to detect when the whole file has been read - I don't know what to suggest, other than some trial and error.

yeah, they have a website and I've already posted a topic there but as I found out just now, the size of the file is initially set to be unlimited, so I guess there's a problem with my server...

To answer your question - I have tried to put a print after the while terminates and I get the correct result for the smaller files, i.e. POST header, connection details, and the data transferred, but for the larger files I get everything but the data (including the content-length header). So I am not sure if I am reading the request correctly.

Hey guys - sorry to butt in, but I really think I know what's wrong here. The read loop is terminating when the input buffer contains less than 1 line, guaranteed to before EOF if the file is > 1 TCP/IP block. Terminate the read loop only when readLine returns null or throws an Exception.
If I'm wrong please say so.
J

That's just an ordinary HTTP GET for the (site default) index.html file. No hint of anything being uploaded. It's waiting for you to send it index.html.
I think this is the wrong test case, or at least the wrong part of it.

For BufferedReader that would be the ready() call he used incorrectly before - it tells you if there are bytes sitting in a buffer waiting for you to read, but not if the source has finished sending any down the stream.

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...