Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

在electron中调用webdav包中的putFileContents方法报错

问题描述

我正在使用 electronVue 框架开发一个可以管理 webdav 服务器上的文件的工具,但是遇到了不知道是如何发生的错误。

报错信息和截图

TypeError: Url must be a string. Received undefined

image.png

相关代码

/**
 * 上传文件
 * @param {object} client webdav对象
 * @param {string} localPath 本地路径
 * @param {string} path 远程路径
 */
export const uploadFile = (client, localPath, remotePath) => {
    let data = fs.readFileSync(localPath);
    return client.putFileContents(
      remotePath + '/' + path.basename(localPath),
      data
    );
};

这个问题困扰了我很长时间,多方查找也没找到报错原因,希望能得到解决方案。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...