在cordova中创建文件非常容易, 请使用以下代码在特定文件夹中创建文件。此代码可在所有cordova平台上使用()
var path = "file:///storage/emulated/0";
var filename = "myfile.txt";
window.resolveLocalFileSystemURL(path, function(dir) {
dir.getFile(filename, {create:true}, function(fileEntry) {
// The file has been succesfully created. Use fileEntry to read the content or delete the file
});
});
请记住, 你需要来自cordova的文件插件, 请在此处阅读和学习如何使用它。你可以使用以下命令将文件插件下载到你的项目中:
cordova plugin add cordova-plugin-file
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_50382.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57