Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list files/folders in owncloud with php curl

Tags:

php

curl

owncloud

this is a strange question but following some of the owncloud api and working with curl i can get a json or a xml output with <url>/cs/v1.php/apps/files_sharing/api/v1/shares

my question is if files_sharing is the only one app that works or if for example files app has another parameters that are not documented.

Thanks in advance.

like image 589
Néstor Avatar asked Oct 17 '14 16:10

Néstor


1 Answers

The Share is an API specific just for get the info of the sharing files/folders and also to share them.

To obtain the list of files/folders of a directory you must to use the access through the webdav interface that it is localted under the path remote.php/webdav/ of your server.

For example to get the list of files of the root folder you can use this command:

curl -X PROPFIND -u user:password "http://yourserver.com/owncloud/remote.php/webdav/"

Also you have more http methods to make more things:

  • PROPFIND = get the list of files/folders
  • MKCOL = create folder
  • DELETE = delete file/folder
  • MOVE = move or rename a file or folder
  • PUT = upload file
  • GET = download file
like image 125
Javier Gonzalez Avatar answered Nov 17 '22 06:11

Javier Gonzalez