- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用cordova.file
将图像下载到dataDirectory
中。我正在将文件保存到内部应用程序文件夹中。在模拟器中我可以看到下载的文件,但在真实设备上我无法看到下载的文件。这是我的路径看起来像
$scope.Download = function () {
var FileURL = appService.downloadFiles($scope.selectedFile.FileKey);
var targetPath = cordova.file.dataDirectory + "ChatApp/" + $scope.selectedFile.FileName;
var trustHosts = true;
var options = {};
$cordovaFileTransfer.download(FileURL, targetPath, options, trustHosts)
.then(function (result) {
alert('file downloaded successfully');
console.log(result);
refreshMedia.refresh(targetPath);
}, function (err) {
console.log(err);
}, function (progress) {
console.log(progress);
});
};
}
在cordova.file.dataDirectory
中创建文件夹是否需要任何权限。我如何在内部应用程序文件夹中看到此文件。
最佳答案
您正在使用cordova.file.dataDirectory
。在真实设备中,您无法使用文件管理器/第三方应用程序访问此文件夹。这是出于安全原因。如果您想查看下载的文件,请使用 cordova.file.externalDataDirectory
而不是 cordova.file.dataDirectory
。然后您可以在内存中的应用程序文件夹中看到该文件。
关于cordova.file.dataDirectory 不在应用程序文件夹内创建文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41458966/
这是 Where is that file on my system? 的后续问题 SO 和互联网上有大量的问题和答案,但我找不到任何可以回答这个特定问题的答案。 一切都是默认的,但我找不到文件本身,
使用cordova.file将图像下载到dataDirectory中。我正在将文件保存到内部应用程序文件夹中。在模拟器中我可以看到下载的文件,但在真实设备上我无法看到下载的文件。这是我的路径看起来像
使用cordova.file将图像下载到dataDirectory中。我正在将文件保存到内部应用程序文件夹中。在模拟器中我可以看到下载的文件,但在真实设备上我无法看到下载的文件。这是我的路径看起来像
我对 IMAGE_OPTIONAL_HEADER.DataDirectory 有点困惑。作为PE/COFF Specification说, Header part: Data Directories
我正在编写一个程序,要求用户在应用程序启动时选择事件数据库。我有一个 Windows 窗体,它将列出存储在 ApplicationData 的子文件夹中的数据库,专门用于存储数据库文件。然而,当我创建
我的解决方案有一个带有数据库的类库项目(我的 DAL)和一个充当 WCF 服务层的 Web 项目。 我从web项目中添加了对DAL项目的引用,编译时,我的数据库被复制到web项目的Bin文件夹中。 W
在网上搜索了六个小时后,我希望能在 SO 上找到答案。 平台:Windows, ionic 框架,目标设备:Android/iOS 7.1.2 我想在我的应用程序文件夹中写一个文件,所以我使用了cor
我正在使用本地数据库,由于某些原因,当我使用 |DataDirectory| 时,数据库在我添加/删除时没有更新 SqlConnection conn = new SqlConnection(@"Da
我正在尝试使用 FileTransfer Ionic 4 example . 我已经执行了安装步骤: ionic cordova plugin add cordova-plugin-file npm
我正在以编程方式创建一个 SQL CE 数据库文件,并且想确保每次都创建一个全新的文件,所以我添加了 delete 方法。由于每个数据库文件都是在 DataDirectory 中创建的,因此我也想删除
我有一个数据库和一个服务器应用程序,在我的计算机上运行时一切正常。 string ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFi
我得到了异常(exception) The underlying provider failed on ConnectionString. 有内部异常(exception) Invalid value
我的用户 file transfer下载需要的文件File native还 在 ionic v3 我用过没问题,但现在在 ionic v4 当我使用它时,出现错误:"file"类型上不存在属性“dat
我有一个使用 localdb 的 MVC4/ASP.Net 应用程序。一切“看起来”都正常工作。但是,我的事件日志中出现了大量错误: The "DataDirectory" registry valu
在我的应用程序中,用户可以从图库中选择一张图片,该图片将用于“用户详细信息”。因此,创建了一个屏幕,他存在一个名为"file"的输入文件。我需要将选择的图像复制到 externalDataDirect
this.file.dataDirectory 显示为 null,我已经在全局安装了 cordova,但仍然找不到任何解决方案。我在哪里犯了错误? download() { const fil
使用 ionic 2 访问文件系统时, File.dataDirectory 不工作。我已经安装了 ionic-native 并导入了文件(cordova-plugin-file)。 import {
我正在尝试设置 src的 在来自文件字符串路径的 html 上。 路径取自cordova.file.dataDirectory Ionic2 上的 cordova 插件( Typescript ) 看
在我的程序中,我需要从默认位置复制一个模板数据库,据我所知,这将根据我选择使用的安装程序而有所不同。问题是我似乎无法读取 |DataDirectory| 的实际路径我知道我应该使用 AppDomain
我的设置: local packages: Cordova Platforms : android 6.1.2 ios 4.4.0 Ionic Framework : ionic1 1.3.2 Cor
我是一名优秀的程序员,十分优秀!