1

My DELETE query on an element works but the file is still present in the listing (0 bytes). How to fix that (delete as we delete a file on https://my.alfresco.com )

Here is my query :

string accessToken = "my_access_token";

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api.alfresco.com/mywebsite.com/public/cmis/versions/1.0/atom/content?id=" + idFile);
req.Headers.Add("Authorization", "Bearer " + accessToken);

req.Method = "DELETE";
HttpWebResponse webResponse = (HttpWebResponse)req.GetResponse();
var sr = new StreamReader(webResponse.GetResponseStream());
string responseCOntent = sr.ReadToEnd();
MessageBox.Show(webResponse.StatusCode.ToString());
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Rototo
  • 479
  • 1
  • 5
  • 17
  • You appear to be trying to manually perform CMIS operations without the help of a library, which isn't really recommended for beginners! My hunch is you're calling the wrong URL, and are instead deleting the content stream but not the overall item. You'll either need to compare the service document against the CMIS spec, or just use a CMIS library that does all of that for you! – Gagravarr Sep 23 '13 at 12:44
  • Hello again Gagravarr. Yeah I perform this without using a lib. As you said before, the lib is usefull BUT in my case it doesn't work because of authentification. I failed to find the "special username", and anyway it can be strange to use "manual code" for authentification and the lib for operations.... I don't understand why the lib doesn't work with my own credentials and seems that this lib is used more for "local deployment of alfresco" rather than alfresco cloud. – Rototo Sep 23 '13 at 13:06
  • possible duplicate of [How to delete file after REST response](http://stackoverflow.com/questions/26930127/how-to-delete-file-after-rest-response) – Paul Sweatte May 04 '15 at 19:38

0 Answers0