As pointed out yesterday by ZachB in answer to another question, there is a hack that makes URLFetch add a filename to the Content-Disposition header as required by RFC 7578 multipart/form-data section 4.2RFC 7578 multipart/form-data section 4.2:
URLFetch[url,
"Method"->"POST",
"MultipartElements"->{
{"file\"; filename=\"test.jpg","image/jpeg"}->
Import["test.jpg", "String"]
}
]
Here, the Multipart element name is "file" but URLFetch is tricked into adding the filename "test.jpg" by hiding it within a longer element name.