cc7756789
V2EX  ›  Node.js

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

  •  
  •   cc7756789 · Oct 25, 2015 · 4769 views
    This topic created in 3851 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   ·   1072 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:42 · PVG 02:42 · LAX 11:42 · JFK 14:42
    ♥ Do have faith in what you're doing.