웹 개발 의 로 컬 폴 더 만 드 는 실현 방법

1922 단어 web폴 더
웹 개발 의 로 컬 폴 더 만 드 는 실현 방법
 filemanage_util.fullPath 는 파일 을 만 드 는 경로 입 니 다.
이것 은 크로스 플랫폼 의 생 성 폴 더 입 니 다.Android 처럼 Environment.getExternalStorageDirectory()의 네 이 티 브 코드 를 통 해 만 들 지 않 습 니 다.
구현 코드:

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
      // alert('ondeviceReady');
      // window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
      console.log("    ===========>      :            .");
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
        console.log("    ===========>            ");
        //util.appRootDirName     ,   zgky
        fileSystem.root.getDirectory(filemanage_util.appRootDirName, {
          create: true,
          exclusive: false
        }, function (entry) {
          //            fullPath,             ,         ,     toURL()
          //          ,      
          console.log("    ===========>       ,         !");
          filemanage_util.fullPath = entry.toURL();
          // alert(util.fullPath);
          console.log("    ===========>       :" + filemanage_util.fullPath);
          //console.log(util.fullPath);
        }, function () {
          console.log("    ===========>       !");
        });
        console.log("    ===========>            !");
      }, function () {
        console.log("    ===========>       ");
      });
      console.log("    ===========>      :            ");
    };
이상 은 웹 이 로 컬 폴 더 를 만 드 는 실현 방법 입 니 다.궁금 한 점 이 있 으 시 면 메 시 지 를 남기 거나 본 사이트 의 커 뮤 니 티 에 가서 토론 하 십시오.읽 어 주 셔 서 감사합니다. 도움 이 되 셨 으 면 좋 겠 습 니 다.본 사이트 에 대한 지지 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기