• 请不要在回答技术问题时复制粘贴 AI 生成的内容
HLT
V2EX  ›  程序员

有没有什么 JS 库 可以获取 文件夹名称/以及目录下的文件名称等

  •  
  •   HLT · Dec 28, 2016 · 3181 views
    This topic created in 3451 days ago, the information mentioned may be changed or developed.
    19 replies    2016-12-29 01:57:47 +08:00
    airyland
        1
    airyland  
       Dec 28, 2016
    这原生接口就能实现吧, npm 库也很多,比如 walk https://npm.taobao.org/package/walk
    HLT
        2
    HLT  
    OP
       Dec 28, 2016
    @airyland 呃 还有吗
    SoloCompany
        3
    SoloCompany  
       Dec 28, 2016
    airyland
        4
    airyland  
       Dec 28, 2016 via iPhone
    @HLT 自行 google
    araraloren
        5
    araraloren  
       Dec 28, 2016
    ~~ 这问的时间已经写完几个了吧
    Rice
        6
    Rice  
       Dec 28, 2016
    node 不是有 API 吗
    bayallen
        7
    bayallen  
       Dec 28, 2016 via iPhone
    node-directory-tree, complete-directory-tree on Github/npm
    tobeyouth
        8
    tobeyouth  
       Dec 28, 2016
    fs 直接就可以
    xylitolLin
        9
    xylitolLin  
       Dec 28, 2016
    你是说浏览器的 js 还是 node.js
    HLT
        10
    HLT  
    OP
       Dec 28, 2016
    @araraloren 哎,智商不够啊

    @Rice
    @ferrum
    @SoloCompany
    不会 nodejs 原谅我
    HLT
        11
    HLT  
    OP
       Dec 28, 2016
    @xylitolLin 浏览器
    xylitolLin
        12
    xylitolLin  
       Dec 28, 2016
    @HLT 除了 ie ,其他浏览器没有办法,不要想了,这是基于安全理由
    HLT
        13
    HLT  
    OP
       Dec 28, 2016
    @xylitolLin 嗯,在用 PHP 来解决了。。。
    SoloCompany
        14
    SoloCompany  
       Dec 28, 2016
    浏览器读文件,你是在逗我们?
    HLT
        15
    HLT  
    OP
       Dec 28, 2016
    @SoloCompany 你想多了。。。只是去获取目录下文件名称
    HLT
        16
    HLT  
    OP
       Dec 28, 2016
    @SoloCompany ![)_%QNLEF3ERR$[%M9_]B41I.jpg]( https://ooo.0o0.ooo/2016/12/28/586381037ef0d.jpg)
    lslqtz
        17
    lslqtz  
       Dec 28, 2016 via iPhone
    @HLT PHP 读文件,是服务端的?那 js 也可以,读本地 PHP 服务端也读不过来的
    Sparetire
        18
    Sparetire  
       Dec 28, 2016
    浏览器端,通过 File API 或许有可能实现,参考这篇 https://www.cnblogs.com/index-html/p/dialog-phishing.html
    LeoEatle
        19
    LeoEatle  
       Dec 29, 2016
    。。。__dirname?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1005 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 22:29 · PVG 06:29 · LAX 15:29 · JFK 18:29
    ♥ Do have faith in what you're doing.