Wow, you seem to have finally taken the hint. Good job. But, back to this code.
1) you should use (fileSize > counter)
otherwise you will wind up skipping the last bit of data in the file.
2) read(byte[]) is not guaranteed to fully read the entire size of the array. It does however return the number of bytes read, so capture this value.
3) Make sure that you only write as much of the array as was read (see above). Otherwise you may be writing old data again (or at least null bytes, which is nearly as bad).
4) Increment the counter with the amount that was actually read (see 2) as well.
Edit: Except for the fact that this should not be done as a Scriptlet in a JSP. Makes much more sense to do this one in a Servlet.