I am trying to upload files on Google Drive using JMETER but the uploaded file name is 'Untitled'. Google Drive API's Bearer token is used as Authorization in the 'HTTP Header Manager' with Content-Type 'multipart/related; boundary=boundaryname' but still files get uploaded with the filename 'Untitled'.
I am using method 'uploadType=multipart'. If I send file's path in the 'Files Upload' section and metadata json with uploaded file's name and Content-Type. In this case it uploads file with correct name and extension but file is corrupted.
If I send only file's path in 'Files Upload' section and I do not send any metadata json, then file is uploaded fine but its name is Untitled.
When I use text or csv file's data with metadata json in the body of http request then file is uploaded correctly with correct filename and extension.
--jmeter_file
Content-Type: application/json; charset=utf-8
{
"name": "my_filename.txt"
}
--jmeter_file
Content-Type: text/plain
Hi there, I am user101 and use jmeter.
--jmeter_file--
Above body content will upload the file correctly with name my_filename.txt but I do not have always text or csv files to upload, I want to upload pdf, images, videos and document files whose path I need to mention in "Files Upload" section.
Please suggest procedure to upload any filetype correctly with its name and extension.