taiful
taiful
  • 发布:2024-05-18 15:39
  • 更新:2024-06-02 19:25
  • 阅读:115

#插件讨论# 【 本地HttpServer-静态站点-getpost请求-文件上传下载-本地HLS(m3u8)视频播放 - 8***@qq.com 】上传文件

分类:uni-app

let urlPath = "/uploadFile"
var saveDir = plus.io.convertLocalFileSystemURL('_downloads'); // 文件保存目录
httpServer.uploadFile(urlPath, saveDir, (request) => {

        console.log("uploadFile request:" + JSON.stringify(request))  
        console.log("上传文件保存目录:" + saveDir)  
        this.sendJSONResponse(request)  
        // ios:  
        // {"remoteAddress":"172.16.11.60:59430","body":{"age":{"isFile":false,"value":"20"},"name":{"isFile":false,"value":"wrs"},"file":{"fileName":"text.txt","isFile":true,"path":"/var/mobile/Containers/Data/Application/0365A8A9-B926-4571-9C4D-C251DC7AAB26/Library/Caches/Pandora/downloads/text.txt"}},"urlParams":{},"url":"http://172.16.11.44:8888/uploadFile","localAddress":"172.16.11.44:8888","method":"POST","headers":{"User-Agent":"PostmanRuntime/7.32.3","Accept":"*/*","Content-Length":"651","Content-Type":"multipart/form-data; boundary=--------------------------445338919225193221741331","Host":"172.16.11.44:8888","Postman-Token":"d1501ccd-0e2e-407d-89ad-6604f3e3b76f","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive"},"path":"/uploadFile"}  
    }, () => {  
        // 添加uploadFile完成  
    });  

我用这个接收上传文件,然后我用JS+html写一个上传的HTML文件,上传不上来,没有任何提示

2024-05-18 15:39 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com

有问题可以加QQ252797991咨询

要回复问题请先登录注册