Lester Burnham wrote:
It won't be a good idea to upload such a big size of string, in the form of string.
How do you think the file uploading works? By creating a byte[], and then sending it in the body of an HTTP POST (assuming that's how the upload works - you haven't said anything about that). It is true, though, that not the complete byte[] needs to be in memory - it can be read and sent piecemeal. But writing the contents of a String to disk, only to read it back into memory will certainly not be faster than converting it to a byte[] in memory.
Instead, it is a good idea to first convert it into a file object ( but not on the local drive, but on the fly ) and then insert all such files in a file array and then upload it.
The contents of File objects do not exist in memory - it exists in actual files on a disk (with all the security implications that entails for applets).
Yeah, i know that converting it into a physical file on the local drive, would be an unnecessary step. That's why, i just want to have some file object, in the memory only, because that is what my uploader code accepts.
But i think, as you said, it is not possible to make such file object ( without pointing it on the drive).
So, i am again left with the problem... how to make a communication between uploader code that accepts only a file[ ] , and the number of strings ( say a string array ) .
I cannot write the string uploader separately, because the code is a part of very complex bigger code, and it would take a huge amount of time to make it work with it.