使用Chrome debug attachment upload page:从local laptop上选择一个file之后,断点触发:
![](https://img.haomeiwen.com/i2085791/dc9ab55e2d47b2e7.png)
前端取得user选中的file name:
![](https://img.haomeiwen.com/i2085791/8bb7cc575d4f8b8d.png)
![](https://img.haomeiwen.com/i2085791/fcf6a35358050a82.png)
点Attach button后,触发Application server 的event handler:
![](https://img.haomeiwen.com/i2085791/b08f077d77a62371.png)
![](https://img.haomeiwen.com/i2085791/5c1f55e936fef06e.png)
![](https://img.haomeiwen.com/i2085791/afdca3d928e2e676.png)
从Chrome network tab能观察到,UI向Application server发送了一个http post:
![](https://img.haomeiwen.com/i2085791/59dab5ef3dbb9d8e.png)
LOOP所有form parts:
![](https://img.haomeiwen.com/i2085791/9f9f6e282c1f9f3d.png)
从对应的form part里取出file name, file type:
![](https://img.haomeiwen.com/i2085791/2d52f769974cdff0.png)
以及实际的文件内容(由于security原因,该form part的内容无法在Chrome的network里观察到)
![](https://img.haomeiwen.com/i2085791/bd6be446ba256a6c.png)
![](https://img.haomeiwen.com/i2085791/a134c1e4f5eaa3d7.png)
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
![](https://img.haomeiwen.com/i2085791/fc7ecd97deb67090.png)
网友评论