-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
i am uploading csv file which contains 1365 rows and the file size is 211 kb using following code.
byte[] mediaBytes = null;
Media media = Fileupload.get();
mediaBytes = media.getByteData();
but when i am inspecting object mediaBytes it is showing array with 0 length.
if i will print media.getByteData().length it is printing 0. means it can not take as much records.
if i decrease my file size with 600 records, it works fine.
i am setting max-upload-size in my zk.xml as shown as below but it is not working.
<?xml version="1.0" encoding="UTF-8"?>
<zk>
<system-config>
<max-upload-size>10240</max-upload-size>
</system-config>
<system-config>
<disable-event-thread>false</disable-event-thread>
</system-config>
</zk>
is this issue is ralated to file size. or any server related issue?
kindly provide solution for this.
You need to check if it is in memory or a stream. Some Python code looks like :
if media.inMemory():
buf = ByteBuffer.wrap(media.getByteData())
else:
med = media.getStreamData()
fc = med.getChannel()
buf = fc.map(MapMode.READ_ONLY, 0, fc.size())
You'll have to do your own java conversion.
Asked: 2012-01-05 12:40:43 +0800
Seen: 296 times
Last updated: Jan 06 '12