chenscript
chenscript
  • 发布:2019-02-25 14:53
  • 更新:2019-02-25 14:53
  • 阅读:1433

想把文件复制到save文件夹,现在一直报执行出错

分类:uni-app

uni.downloadFile({
url: url,
//url是服务器上面文件的地址
success: (res) => {
if (res.statusCode == 200) {
var tempFilePath=res.tempFilePath;
//现在已经保存到了临时文件夹,如果用uni.saveFile保存文件是以时间戳命名的,想移动文件到save文件夹并重新命名
var savepath='_doc/uniapp_save'
plus.io.resolveLocalFileSystemURL( tempFilePath, function( entry ) {
// 可通过fs进行文件操作
entry.copyTo( savepath,newname, function( entry ){
console.log("New Path: " + entry.fullPath);
}, function( e ){
console.log( e.message );
} );
}, function ( e ) {
console.log( "Request file system failed: " + e.message );
);
)},
fail(err) {
console.log(JSON.stringify(err))
}
});

2019-02-25 14:53 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复