Reputation: 505
I need a web application which is used to copy the files from usb drive. I can write a java applet to copy the files from usb drive, but chrome will not support applet any more. Could you please suggest any alternative to this? I need a web application not a chrome app.
Upvotes: 2
Views: 18020
Reputation: 2021
Chrome 61+ has an implementation of the WebUSB API
This would not let you issue a command to the OS/File system to, for example:
copy file://some_file_location/myfile.txt
to file://USB_DRIVE/some_folder/myfile.txt
Chrome would need to read the files and write to the device directly. In other words the browser would be copying the files by reading them (see below) and then writing to the USB device. This would probably be quite slow and unfeasible for large files.
Your options to read local files are:
--allow-file-access-from-files
flag. This is a security issue/risk, and users would need to visit your site/application with this already on.input type="file"
or drag & dropNeither of these may be applicable to your problem/solution.
Upvotes: 1
Reputation: 3291
I'd recommend using node.js , its cross platform and can access usb ports from web browser..
Usb Library: https://www.npmjs.com/package/usb
Proof : How to send data to USB device in node.js using libusb
Hope this helps
Upvotes: 0