简体   繁体   中英

GWT client side file upload

I can upload a file with the HTML element inputfile then get the byte stream of this file through FileReader . After calling the function reader.readAsBinaryString(blob) as shown in the "Slicing a file" example I now need to gain an access to the uploaded bytestream of the file in GWT client code. How can I do this?

You would have to store the bytes server side then from the GWT client call the server and retrieve the bytes. Most likely through an RPC call.

See Create Byte Array from GWT File upload Input

"For security reasons browsers can't read files from your file system. (You could use a plugin like a flash plugin to get it to work, although I have no examples at hand)."

use File API of GWT Client side, FileUpload Class;

class is in com.google.gwt.user.client.ui.FileUpload;

BR/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM