Sunday 15 September 2013

api - google drive sdk upload file -


I tried uploading the file, but then the file is called "untitled".

  byte [] FileBytes = System.IO.File.ReadAllBytes (fileName); String UploaderI = String.format ("https://www.googleapis.com/upload/drive/v2/files?uploadType=media&access_token={0}", AccessToken); Var Request = (HttpWebRequest) HttpWebRequest.Create (UploadURI); request. Method = "post"; Request.ContentLength = fileBytes.Length; (Var datastream = request.GetRequestStream ()) using {datastream.Write (fileBytes, 0, fileBytes.Length); } String position = (((HttpWebResponse) request.GetResponse ()). StatusDescription; If (status.ToLower () == "made" || Status. ToLower () == "OK") (uploaded = true;}   

and I have a specific folder How can I upload a file?

Answers to both "end title" and "original folder" questions Meta Data When you post, you must provide a meta data object that contains a title: "title" and parent: [{id: "parent_id"}]

No comments:

Post a Comment