I have a File i want to upload to a Webservice, but it needs additional params, so I create some hidden fields with the associated name:value pairs to get pushed to the serv
How about using HttpRequest.QueryString[]
?
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, UriTemplate = "NewImage")]
string NewImage(Stream data);
you call it through the URL like:
\NewImage?server={server}&datasource={datasource}&document={doc}&image_id={id}
Then in your code:
public string NewImage(Stream imgStream)
{
var request = System.Web.HttpContext.Current.Request;
var server= request.QueryString["server"];
var datasource = request.QueryString["datasource"];
var document= request.QueryString["document"];
var image_id= request.QueryString["image_id"];
...
}
I'd been looking for something like this for a while, and just stumbled across it today.