c# - Retrieve HTTP headers in Cordova File Transfer ASP Server -
i'm trying retrieve custom header cordova file transfer.
i'm sending photo image header along (http post).
cordova side:
... var server = 'http://192.168.2.48/webservice.asmx/saveimage'; var headers={'id':'123'}; var ftoptions = new fileuploadoptions(); ftoptions.filekey = 'file'; ftoptions.filename = imagedata.substr(imagedata.lastindexof('/') + 1); ftoptions.mimetype = 'image/jpeg'; ftoptions.httpmethod = 'post'; ftoptions.headers = headers; var filetransfer = new filetransfer(); filetransfer.upload(imagedata, encodeuri(server), win, fail, ftoptions);
asp side(to retrieve 'file'):
httppostedfile file = httpcontext.current.request.files["file"];
i'm able retreive image data unable headers ('id'), suggestions , ideas appreciated.
plugin github link: https://github.com/apache/cordova-plugin-file-transfer
headers aren't need, need params
var params = {}; params.id = "123"; ftoptions.params = params;
then, on server, use code post data
request.form["id"];
Comments
Post a Comment