Implementation of creating local folders in web development: web Development

Source: Internet
Author: User

Implementation of creating local folders in web development: web Development

How to create a local folder in web Development

Filemanage_util.fullPath is the path of the file to be created.

This is a cross-platform creation folder. Unlike Android, you need to use native code of Environment. getExternalStorageDirectory () to create a folder.

Implementation Code:

Document. addEventListener ("deviceready", onDeviceReady, false); function onDeviceReady () {// alert ('ondeviceready'); // window. requestFileSystem = window. requestFileSystem | window. webkitRequestFileSystem; console. log ("Documentation Center ==========> software ready: Set the detection file storage directory to start. "); window. requestFileSystem (LocalFileSystem. PERSISTENT, 0, function (fileSystem) {console. log ("document center ==========> detect the temporary file storage directory method"); // util. appRootDi RName global variable. Here is zgky fileSystem. root. getDirectory (filemanage_util.appRootDirName, {create: true, exclusive: false}, function (entry) {// fullPath is used in all the materials circulating on the Internet. Here I get the relative directory, when downloading, an error is reported. Therefore, toURL () // is a global variable used to save the console path. log ("document center ==========> the folder is created successfully and relevant parameters are being set! "); Filemanage_util.fullPath = entry. toURL (); // alert (util. fullPath); console. log ("document center ==========> folder created successfully:" + filemanage_util.fullPath); // console. log (util. fullPath) ;}, function () {console. log ("document center ==========> failed to create a folder! ") ;}); Console. log (" document center ============> the method for detecting the temporary file directory is complete! ") ;}, Function () {console. log ("document center ==========> failed to create a folder") ;}); console. log ("Documentation Center ==========> software ready: Set the detection file storage directory to end ");};

The above is the implementation method for creating local folders on the web. If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article and hope to help you. Thank you for your support for this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.