使用electron做的桌面应用,需要自动上传音频文件到阿里云服务器,路径是知道的,在用户不点击选择文件的情况下,就可以上传,尝试了fs,上传失败,求助,不管使用什么技术:node,electron,h5……,能上传就行
天蓬老师2017-04-17 15:48:46
You need to check Alibaba Cloud's interface to see what they accept, and then find out what you use to send.
PHPz2017-04-17 15:48:46
There is definitely no problem reading files with fs. It is recommended that you first try using h5 to manually select whether the file can be uploaded. After success, you can use fs to read the file locally and upload it.
http://blog.tingyun.com/web/a...
I wonder if this can give you some inspiration.
ringa_lee2017-04-17 15:48:46
Open a new thread to upload files.
Deploy any file upload interface on the server, including PHP, .NET, and NODEJS. Then make a local web page to test the file upload. After adjusting, use the desktop program to debug.
Pay attention to the read and write permissions of the upload directory, the server's restrictions on file upload format and size, and whether the remote call interface involves cross-domain issues (generally POST is not allowed across domains).