V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cc7756789
V2EX  ›  Node.js

express 处理 enctype='multipart/form-data'的数据难道要用正则吗?

  •  
  •   cc7756789 · Oct 25, 2015 · 4741 views
    This topic created in 3836 days ago, the information mentioned may be changed or developed.
    ------WebKitFormBoundary8nY5SzaDkM3oRpBL
    Content-Disposition: form-data; name="interval"
    
    1
    ------WebKitFormBoundary8nY5SzaDkM3oRpBL
    Content-Disposition: form-data; name="lang"
    
    1
    ------WebKitFormBoundary8nY5SzaDkM3oRpBL
    Content-Disposition: form-data; name="published"
    
    2015
    ------WebKitFormBoundary8nY5SzaDkM3oRpBL--
    

    如果含有文件, 会乱码!

    2 replies    2015-10-25 15:51:39 +08:00
    faceair
        1
    faceair  
       Oct 25, 2015
    body-parser 拯救你
    ETiV
        2
    ETiV  
       Oct 25, 2015 via iPhone
    去看 express 文档,里面提到了几个组件来做 file 的处理
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   860 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 21:56 · PVG 05:56 · LAX 14:56 · JFK 17:56
    ♥ Do have faith in what you're doing.