2017-12-18 5 views
0

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.が記録されます。ストレージサイズが変わらないためでしょう。

私は間違いをしましたか、これを行う別の方法がありますか?

+1

私はクロームストレージにはこうしたものに十分なスペースがないと思います – Granny

答えて

0

ファイルシステムの空き領域を確認してください。

私の場合、空きディスク容量に問題がありました。私は1 * 1024 * 1024を求めて、1TBディスクから7GBの空きがありました。これは、df -hを使って100%満杯でした。 28GBを削除して97%がいっぱいになり、作業を開始しました。

関連する問題