Struts FormFile getFileData - is there a limit on the size of the data returned

B

Ben Jessel

Strut's FormFile.getFileData() returns a byte representing the file
data.
As an array takes an integer index ( ie. data i can be up to 65536
), doesn't this place a limit of 64K worth of primitive data being
returned?

Does this mean that when calling methods using byte[], we are limited
to passing a maximum of 64K?

Thanks
 
C

Christophe Vanfleteren

Ben said:
Strut's FormFile.getFileData() returns a byte representing the file
data.
As an array takes an integer index ( ie. data i can be up to 65536
), doesn't this place a limit of 64K worth of primitive data being
returned?

Does this mean that when calling methods using byte[], we are limited
to passing a maximum of 64K?

Thanks


You have the size of integers wrong. In java, an int is always 32 bits, not
16.
 
S

Sudsy

Ben said:
Strut's FormFile.getFileData() returns a byte representing the file
data.
As an array takes an integer index ( ie. data i can be up to 65536
), doesn't this place a limit of 64K worth of primitive data being
returned?

Does this mean that when calling methods using byte[], we are limited
to passing a maximum of 64K?

Thanks


Christophe addressed your misconception of the array index limit
but I've got to ask whether you're using the right method in the
first place. I use FormFile.getInputStream and copy the contents
to a local file and I KNOW it doesn't limit you to 64K; I had to
add maxFileSize="100K" to my controller element in struts-config.xml
to prevent uploading of huge images!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top