Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript-将图像保存到内部存储器_Javascript - Fatal编程技术网

Javascript-将图像保存到内部存储器

Javascript-将图像保存到内部存储器,javascript,Javascript,我正在从服务器下载一个blob格式的图像,然后将其转换为url并显示该图像 var nImageRequest=new-XMLHttpRequest(); nImageRequest.open(“POST”http://xx.xx.xx.xxx/server/api/download_image.php“,对); setRequestHeader(“内容类型”,“应用程序/x-www-form-urlencoded”); nImageRequest.responseType='blob'; nI

我正在从服务器下载一个blob格式的图像,然后将其转换为url并显示该图像

var nImageRequest=new-XMLHttpRequest();
nImageRequest.open(“POST”http://xx.xx.xx.xxx/server/api/download_image.php“,对);
setRequestHeader(“内容类型”,“应用程序/x-www-form-urlencoded”);
nImageRequest.responseType='blob';
nImageRequest.onreadystatechange=函数(oEvent){
if(nImageRequest.readyState==4){
如果(nImageRequest.status==200){
var image=新图像();
var url=window.url | | window.webkitURL;
image.src=url.createObjectURL(nImageRequest.response);
document.body.appendChild(图像);
//webkitRequestFileSystem(window.PERSISTENT,1024*1024,SaveDatFileBro);
}
}
};
发送(imageFilename);

现在,我想把它存储在用户手机的内部存储器中。如何使用
javascript

本地存储呢?我已经这样做了,但我希望我的用户将图像保存在手机的内部存储或sd卡中。啊,好的!如果您正在使用phonegap,这可能会有所帮助@我看到了这个解决方案。它是否适用于android手机??