Search code examples
pythonwebdavowncloud

Get md5 from Owncloud with Webdav


I'm using Webdav to synchronize files into my Owncloud. All working very fine.

But I need get MD5 from files in my result list. And i'm not having success in do this, and I not found nothing on owncloud's documentation. There are a way to receive the md5 file that's stored on owncloud?

I imagine it is some setting in ownCloud, or the header of the request should be made. But really I did not find anything on how to achieve this.


Solution

  • This is a method to get the hash. (I'm not sure this is the most correct way).

    \OC\Files\Filesystem::hash('md5',$path_to_file);
    

    (ex. 8aed7f13a298b27cd2f9dba91eb0698a)