Jmeter 初识三 —— File upload by Jmeter

最近开始测试的接口中设计到了文件的上传和下载。

这版文章就文件上传下载的几种方式进行简略说明。

1. File upload by Web.

  Configure the HTTP Request Sampler with the following detail in order to perform the file upload action-

  • Server Name and Path parameters will be name of the server and its Path for the upload functionality
  • File upload in JMeter will be a HTTP Post request. So, we would be required to select POST Method in HTTP Request sampler.
  • Uploading file to server requires building a multipart/form-data request. For this we will check multipart/form-data for POST checkbox in HTTP Request sampler.

关于 MIME Type 请参考: 

https://www.lifewire.com/file-extensions-and-mime-types-3469109

https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types

这里我遇到了一个问题,如下:

错误点在于,我在 Request Head Manager那里设置了content-type : application/json . 但是此处只是上传file ,不包括具体的内容。 就导致设置了两部分的设置,删除之后就可以了。

执行,upload成功。

2. File upload by FTP

FTP: 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值