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.

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题