Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*//String file = "file=@" + Application.StartupPath + "\\tmp.jpg";
- url = "https://api.cloud.appcelerator.com/v1/photos/create.json?key=esfob3KF1R2zBRh8vroMQCCMlQCP44xx&_session_id=" + session;
- wrGetUrl = (HttpWebRequest)WebRequest.Create(url);
- NameValueCollection nvc = new NameValueCollection();
- HttpUploadFile(url, Application.StartupPath + "\\tmp.jpg", "file", "image/jpeg", nvc);
- //String boundary = "B0unD-Ary";
- string boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
- wrGetUrl.ContentType = "multipart/form-data; boundary=" + boundary;
- wrGetUrl.Method = "POST";
- //String postData = "--" + boundary + "\nContent-Disposition: form-data\n\n";
- //postData += "myId=123&someFk=456";
- //postData += "\n--" + boundary + "\nContent-Disposition: form-data; name=\"file\" filename=\"" + Application.StartupPath + "\\tmp.jpg" + "\"\nContent-Type: image/jpeg\n\n";
- //byteArray = Encoding.UTF8.GetBytes(postData);
- //byte[] filedata = null;
- //using (BinaryReader readerr = new BinaryReader(File.OpenRead(Application.StartupPath + "\\tmp.jpg")))
- // filedata = readerr.ReadBytes((int)readerr.BaseStream.Length);
- //wrGetUrl.ContentLength = byteArray.Length + filedata.Length;
- //wrGetUrl.GetRequestStream().Write(byteArray, 0, byteArray.Length);
- //wrGetUrl.GetRequestStream().Write(filedata, 0, filedata.Length);
- //wrGetUrl.ContentLength = file.Length;
- //byteArray = Encoding.ASCII.GetBytes(file);
- objStream = wrGetUrl.GetResponse().GetResponseStream();
- reader = new StreamReader(objStream);
- line = reader.ReadToEnd();
- jo = JObject.Parse(line);
- meta = jo.SelectToken("meta").ToString();
- jo = JObject.Parse(meta);
- status = jo.SelectToken("status").ToString();*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement