Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Jmeter中将图像转换为base64_Jmeter_Base64_Beanshell - Fatal编程技术网

在Jmeter中将图像转换为base64

在Jmeter中将图像转换为base64,jmeter,base64,beanshell,Jmeter,Base64,Beanshell,我是Jmeter的新手,需要一些指导。我试图从一个目录中读取大量图像,需要在Jmeter中将每个图像转换为base64。如果我理解正确,我可以在HTTP请求中使用u FileToString。但是,我需要先转换它,然后传递到请求。 我曾尝试使用ForController,并使用BeanShell Sampler在互联网上进行转换,但结果显示图像已损坏。你能告诉我怎么做吗?谢谢。而且我听说了 因此,您可以使用以下方法将图像转换为其Base64表示: ${__groovy(new File('/pa

我是Jmeter的新手,需要一些指导。我试图从一个目录中读取大量图像,需要在Jmeter中将每个图像转换为base64。如果我理解正确,我可以在HTTP请求中使用u FileToString。但是,我需要先转换它,然后传递到请求。 我曾尝试使用ForController,并使用BeanShell Sampler在互联网上进行转换,但结果显示图像已损坏。你能告诉我怎么做吗?谢谢。

而且我听说了

因此,您可以使用以下方法将图像转换为其Base64表示:

${__groovy(new File('/path/to/your/image.png').bytes.encodeBase64().toString(),)}