upload - ServiceStack PostFIleWithRequest "has" hard coded content-disposition name field -


i have issue postfilewithrequest<> method in servicestack in name of file field hard coded word "upload">

part of data stream

content-disposition: form-data;name="upload";filename="julie.mp3" 

and line 407 in file serviceclientbase.cs

         stream.write("content-disposition: form-data;name=\"{0}\";filename=\"{1}\"{2}{3}".formatwith(new object[] { "upload", filename, text, text })); 

this contained in virtual method not know how can change in derived class there other methods not accessible new class.

public virtual tresponse postfilewithrequest<tresponse>(string relativeorabsoluteurl, stream filetoupload, string filename, object request) 

any ideas?

this bug me name of form-data;name should configurable , not hard coded.

in case need file in name called "file" in order use specific api.

chris

i submitted pull request servicestack (albeit v4) has been accepted , included in next version 4.0.14.

this adds optional parameter of fieldname postfilewithrequest<tresponse> method allows specify field name instead of being stuck upload.

so new signature of method:

public virtual tresponse postfilewithrequest<tresponse>(string relativeorabsoluteurl, stream filetoupload, string filename, object request, string fieldname = "upload") 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -