i am trying to access the data of an image file uploaded by a client .
here is the code .
here is the client code ( in C# if it helps ) .
here is the code .
auto data = req.extract_vector().get();
FILE* out = NULL;
if(!(out = fopen("a.jpg","wb+")))
return false;
fwrite(&data[0],1,data.size()*sizeof(uchar),out);
fclose(out);
but the uploaded file is not a valid image file .here is the client code ( in C# if it helps ) .
WebClient client = new WebClient();
Uri uri = new Uri(@"http://localhost:8085");
byte[] ret = client.UploadFile(uri, "C:\\a.jpg");
Console.WriteLine(ret.ToString());