Thursday, 15 January 2015

c# - Uploading a captured image to parse (Parse object) -



c# - Uploading a captured image to parse (Parse object) -

i trying develop android application using xamarin(c#) , parse user capture pic , upload parse. know how upload text file new have no thought how deal image file can please help. how uploading text file

byte[] info = system.text.encoding.utf8.getbytes("this content of text file"); parsefile file = new parsefile("resume.txt", data); await file.saveasync(); parseobject gamescore = new parseobject("gamescore"); gamescore["score"] = 0001; gamescore["playername"] = " bob"; gamescore["e"] = file; await gamescore.saveasync();`

can please help me problem.. thanks.

parse has entire section of docs devoted dealing files.

// file in system.io byte[] info = file.readallbytes(path_to_your_image); parsefile file = new parsefile(name_of_your_file, data); await file.saveasync(); // link file object parse object gamescore["image"] = file;

update:

the docs say

it's of import give name file has file extension. lets parse figure out file type , handle accordingly. so, if you're storing png images, create sure filename ends .png.

c# android xamarin parse.com

No comments:

Post a Comment