How to use the webdav function in webdav

To help you get started, we’ve selected a few webdav examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat / packages / rocketchat-file-upload / ufs / Webdav / server.js View on Github external
constructor(options) {

		super(options);


		const client = new Webdav(
			options.connection.credentials.server,
			options.connection.credentials.username,
			options.connection.credentials.password,
		);

		options.getPath = function(file) {
			if (options.uploadFolderPath[options.uploadFolderPath.length - 1] !== '/') {
				options.uploadFolderPath += '/';
			}
			return options.uploadFolderPath + file._id;
		};

		client.stat(options.uploadFolderPath).catch(function(err) {
			if (err.status === '404') {
				client.createDirectory(options.uploadFolderPath);
			}

webdav

WebDAV client for NodeJS

MIT
Latest version published 4 days ago

Package Health Score

80 / 100
Full package analysis