Help with PostFileWithRequest (or alternative)

I am POSTING to a web service (not SS) which wants the data to look like this:

------WebKitFormBoundaryiWW3t1uvuxBu0zpb
Content-Disposition: form-data; name=“portalId”

0119821
------WebKitFormBoundaryiWW3t1uvuxBu0zpb
Content-Disposition: form-data; name=“logo”; filename=“New Logo.jpg”
Content-Type: image/jpeg

I am trying to use PostFileWithRequest like this:

var asdas = new PortalImageRequest();
asdas.PortalId = txtEliteNumber.Text;
var files = new FileStream(“logo.jpg”,FileMode.Open);

var asdas1 = jsClient.PostFileWithRequest(“https://thesite.com/portalImages",files,"logo.jpg”, asdas,“logo”);

but this always results in this, according to fiddler:

–b4e1e595-2728-4cef-843a-3a19b06a0bbf
Content-Type: text/plain; charset=utf-8
Content-Disposition: form-data; name=“portalId”

1941913
–b4e1e595-2728-4cef-843a-3a19b06a0bbf
Content-Disposition: form-data; name=file; filename=logo.jpg
Content-Type: image/jpeg

Note that the name does not appear to be set properly based on what i see here:

i tried with new FileInfo(“logo.jpg”) as well but same result

so, how can i change the name of the field being sent? is there a way to do the same kind of thing witth httputils?

thanks!

Note: The Service Clients are only meant for calling ServiceStack Services but the PostFileWithRequest APIs does have an optional fieldName param in their APIs:

right, and i am using that, but it is NOT setting the fieldName as expected.

jsClient.PostFileWithRequest(“https://thesite.com/portalImages",files,"logo.jpg”, asdas,“logo”);

this is what i am asking about, because from the code, it should be flipping fieldName to “logo” in my case, but it is not

i tried BOTH stream and fileinfo approaches too.

any ideas?

We have integration tests showing it working in FileUploadTests.cs, I don’t know what the issue with the 3rd Party API is, it’s also not clear why the params are not quoted any where the Content-Type came from, i.e:

Content-Disposition: form-data; name=file; filename=logo.jpg
Content-Type: image/jpeg

As the file is written with quoted params & without a File Content-Type:

this is a goofy API for sure. ill see if i can find a workaround, but wanted to use SS as you make it so easy!