How to Create a New Folder for Downloading a File

前端 未结 2 2027
逝去的感伤
逝去的感伤 2021-01-21 08:52

I want to download folder that client side (browser) make.

I considered using File API, but I can\'t find how to make folder.

For example, some png make from ht

2条回答
  •  自闭症患者
    2021-01-21 09:17

    Firstly, You can't really interact with the local system or the server with JavaScript because of security. You can call a server-side script with JavaScript, via AJAX.

    If you don't care, you can check out Javascript FSO CreateFolder Method

    JavaScript Example...

    // initialize ActiveXObject and create an object of Scripting.FileSystemObject.  
    var fso = new ActiveXObject("Scripting.FileSystemObject");  
    
    // creates a folder with specified name at the specified location  
    fso.CreateFolder("C:\\Temp\\myFolder");  
    
    fso = null;  
    

提交回复
热议问题