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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -