# Revision history [back]

Hi Frank,

I just double-checked with a very simple example (using ZK 6.5.4) and ZK does exactly what you describe out of the box.

<zk>
</div>
</zk>


my View Model

package zk.forum.upload;

import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.util.media.Media;

public void onUpload(@BindingParam("media") Media media) {
System.out.println(media.getStreamData());
}
}


When you drag a large file over the button, it will start the upload, showing a progress bar giving you the chance to cancel the upload. Observing the memory, I could not notice any significant increase. And in the command handler method in the end you'll see that the stream is actually a FileInputStream. It is pointing to a temporary file in your user's temp folder.

If the behaviour is not the same in your case, please give me details about which exact ZK version you are using or an example to reproduce the memory increase leading to the exception.

Regards,

Robert

Hi Frank,

I just double-checked with a very simple example (using ZK 6.5.4) and ZK does exactly what you describe out of the box.

<zk>
</div>
</zk>


my View Model

package zk.forum.upload;

import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.util.media.Media;

public void onUpload(@BindingParam("media") Media media) {
System.out.println(media.getStreamData());
}
}


When you drag a large file over the button, it will start the upload, showing a progress bar giving you the chance to cancel the upload. Observing the memory, I could not notice any significant increase. And in the command handler method in the end you'll see that the stream is actually a FileInputStream. It is pointing to a temporary file in your user's temp folder.

If the behaviour is not the same in your case, please give me details about which exact ZK version you are using or an example to reproduce the memory increase leading to the exception.

Regards,

Robert

Support Options
• Email Support
• Training
• Consulting
• Outsourcing