duanbixia7738 2017-07-20 06:49
浏览 100

Jmeter手动文件上传发布请求

after strugelling for about a week to get an old ASP.net site to accept a multipart form Post request I finally got it to work with a bit of a work around the trick is that Jmeters multipart form functionallity wasnt working properly for this site, so now i have to write the Post request in the Body manually. But the problem is again on the upload file part. I am able to upload empy .txt files but i am unable to upload .png .jpeg i susspect that i am doing something wrong. I read on a site that i am supposed to use _FileToString somehow to upload an existing file but i have no idea how i am supposed to do that. Full POST request image

WebKitFormBoundaryBbo97BWEj5UehRpp Content-Disposition: form-data; name="ctl00$ContentPlaceHolder1$8$9$fu_appDocument$fu_document"; filename="StacktraceKnijki.png" Content-Type: image/png

Can someone help me turn this into a working upload file request? Thank you.

  • 写回答

1条回答 默认 最新

  • dongpo5239 2017-07-20 08:33
    关注

    Why don't you just record the file upload request using JMeter's HTTP(S) Test Script Recorder? JMeter should be smart enough to produce the relevant HTTP Request sampler from the captured request.

    The only pre-requisite is having your StacktraceKnijki.png file in JMeter's "bin" folder during the recording process, see Recording File Uploads with JMeter guide for more details.

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?