Chromeブラウザでのみ動作する必要があるアプリケーションを作成しようとしています。 これは、ドラッグドロップ機能を使用してフォルダをアップロードできることの一部です。保存フォルダにフォルダを作成できませんでした
私が今直面しています問題は、私もでドロップされたファイル/フォルダをコピーするために一時フォルダを作成することができなかったことである。以下
コード
navigator.webkitPersistentStorage.requestQuota(1024 * 1024 * 500, function (bytes) {
console.log('Allocated ' + bytes + ' bytes.');
// request file system
window.webkitRequestFileSystem(PERSISTENT, bytes, function(fileSystem) {
fs = fileSystem;
cwd = fs.root;
//log query usage and quota
navigator.webkitPersistentStorage.queryUsageAndQuota(
(used, total) => console.log(
`using ${used} out of ${total}, or ${used/total*100}%`)
);
//create temp folder
cwd.getDirectory('/temp', {create: true, exclusive: true}, function(directory){
multiplefilesDirectory = directory;
console.log('directory',directory,multiplefilesDirectory);
}, onError);
});
}, function (e) {
console.log('Failed to allocate persistant storage!');
});
であるに間違いはありませんrequestQuota。ログするAllocated 524288000 bytes.
queryUsageAndQuotaは、using 0 out of 0, or NaN%
を記録します。これは、ストレージサイズが変更されていないようです。
一時フォルダを作成すると、エラーError: The operation failed because it would cause the application to exceed its storage quota.
が記録されます。ストレージサイズが変わらないためでしょう。
私は間違いをしましたか、これを行う別の方法がありますか?
私はクロームストレージにはこうしたものに十分なスペースがないと思います – Granny