SURFdrive: Your safe and secure personal storage!

What is WebDAV?

SURFdrive is accessible via the WebDAV protocol. However, using WebDAV means that all actions are executed via the server. Every time a user saves or edits a file, he will have to wait until WEBdav has executed this action via the SURFdrive server.When a folder with a large number of files is opened, the WebDAV client will get those from the server one by one.

With the SURFdrive sync client files are locally saved and subsequently synchronized by the client in the background. Therefore, this is much more user-friendly. For this reason we always advise to make use of the SURFdrive client (or in the case of Linux, the OwnCloud client).

At the bottom of the following page we explain how to configure WebDAV: https://www.surf.nl/en/store-and-share-your-files-securely-in-the-cloud-with-surfdrive/tutorials

For more information see also the OwnCloud documentation: https://doc.owncloud.org/server/10.0/user_manual/files/access_webdav.html.

WebDAV set up

To be able to use the WebDAV protocol with external applications, a set of WebDAV credentials needs to be created which consists of a user name and a password. The user name is the same as your user name for the SURFdrive service.

Attention! Your WebDAV credentials are not the same as your institution credentials

When you logged in to the SURFdrive service via your browser or using the SURFdrive client, you have used your institutional credentials. These are not the same as the WebDAV credentials created here!

In the SURFdrive web interface, click on your name at the top right, then select 'Settings'. In the 'General' menu you can find your (WebDAV) user name:

Then click on 'Security' in the left sidebar and scroll down to the 'WebDAV passwords' section. Here you can generate a WebDAV password.

Fill in an 'App name' (this can be any name and only serves for your reference, it is only visible to you) and click on 'Create new app password'.

A new WebDAV user name and password set is created. Use this in an external application and make sure it is saved properly there.

The newly created WebDAV user name and password are only shown at this moment. Once you click on 'Done' they will become invisible and can no longer be shown in SURFdrive. The set is shown as an entry in the above table though and is still valid for use.

You can create as many credential sets as you like. Use this possibility to create different sets for different applications for increased security.

Removing WebDAV passwords

In case a WebDAV user name or password is no longer needed (or possibly compromised) you can easily remove it by clicking on the trash bin icon next to the name in the table. The set will be removed immediately and is no longer valid.

WebDAV usage

With your WebDAV credentials you can now access your files through a WebDAV program. To do this you will use the following:

Example with Cyberduck:

Examples

Here you can find some examples of how you can use WebDAV

Uploading a file using cURL

Upload your files to SURFdrive using cURL.

Creating a folder on SURFdrive

curl -u username:password -X MKCOL "https://surfdrive.surf.nl/files/remote.php/nonshib-webdav/folder_name "

File upload to a SURFdrive folder

 curl -u username:password -T filename.extension "https://surfdrive.surf.nl/files/remote.php/nonshib-webdav/folder_name/filename.extension"

If you prefer not to use your username and WebDAV password in a script, you can also upload to SURFdrive via a folder with a public link:

  1. Create a folder with public link*.
  2. Check the box 'password protect' and set a password
  3. Check the box 'allow editing'
  4. Copy the string at the end of the link
  5. Notice! As you can see in the line below, the webdav link for a public URL is different!

    (Scroll down for the screenshots)


File upload to a public link with a password

 curl -u publieke_link_string:password -T filename.extension "https://surfdrive.surf.nl/files/public.php/webdav/"


*After clicking on the share icon in the web interface, a 'Sharing' menu will appear on the right where you can check the above options, see below.


For downloading from a public share, you need the public webdav endpoint. Example;

curl -u "<share_id>:<password>" "https://surfdrive.surf.nl/files/public.php/webdav/" -o file.txt



Additional information

If you have questions about this functionality, please contact your institutional helpdesk in the first place. They will forward your question to us if they cannot provide a good answer themselves.

You can also look at the documentation of SURFdrive's supplier, ownCloud:  https://doc.owncloud.com/server/10.3/user_manual/files/access_webdav.html#accessing-files-using-curl



  • No labels