I'm new to ASP.NET but have some knowledge on using JMeter. My task is to create a web-service which accepts file uploaded via POST request.
My Controller
public class TestController : Controller {
[HttpPost]
public string Upload(HttpPostedFileBase file) {
Logger.Debug("Upload Called, Request.Files.Count: " + Request.Files.Count);
if(model.file != null)
Logger.Debug("Okay");
else
Logger.Debug("Invalid file");
return "done";
}
}
My JMeter sampler
JMeter HTTP request sampler
The test.csv file and my JMeter test plan are put under the same directory.
I however find the file variable is always null, and Request.Files.Count is always 0. Please help, Thanks in advance!