void camera_PictureCaptured(Camera sender, GT.Picture picture) { InitDisplay(); display_TE35.SimpleGraphics.DisplayImage(picture, 0, 0); string reaURI = "http://" + reqHOST + ":" + reqPORT + "/gadg/Service1/transfer/" + lightMEAS.ToString() + "/" + humMEAS.ToString() + "/" + tempMEAS.ToString(); POSTContent postCont = POSTContent.CreateBinaryBasedContent(picture.PictureData); var req = HttpHelper.CreateHttpPostRequest(reaURI, postCont, "image/bmp"); req.ResponseReceived += new HttpRequest.ResponseHandler(req_ResponseReceived); req.SendRequest(); DisplayText(2, "Req sent - PicSize: " + picture.PictureData.Length.ToString()); DisplayText(3, "MEAS li:" + lightMEAS.ToString() + " hu:" + humMEAS.ToString() + " te:" + tempMEAS.ToString()); }
//Metodo para subir los archivos a un servidor private void sendBitmapToServer(GT.Picture picture) { if (ethernetJ11D.IsNetworkUp) { try { //POSTContent content = POSTContent.CreateBinaryBasedContent(currentBitmap.GetBitmap()); POSTContent fileToUpload = POSTContent.CreateBinaryBasedContent(picture.PictureData); HttpRequest pedido = HttpHelper.CreateHttpPostRequest("http://christianvergara.net16.net/upload.php?submit=true&action=upload", fileToUpload, "multipart/form-data"); pedido.SendRequest(); pedido.ResponseReceived += pedido_ResponseReceived; Debug.Print("Imagen enviada"); } catch (System.ObjectDisposedException oe) { Debug.Print("Error in sendBitmapToCloud(): " + oe.Message); } } }