-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
slug: /webdav | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
import UppyCdnExample from '/src/components/UppyCdnExample'; | ||
import CompanionOptions from './_companion-options.mdx'; | ||
|
||
# Import from WebDAV | ||
|
||
WebDAV (Web Distributed Authoring and Versioning) is an extension of the HTTP | ||
protocol that enables users to manage files on remote servers. It supports | ||
uploading, downloading, editing, and organizing files over the web, making it a | ||
versatile option for remote file storage and collaboration. | ||
|
||
## When should I use this? | ||
|
||
When you want to let users import files from any WebDAV supported service, such | ||
as Nextcloud, OwnCloud, and Box. | ||
|
||
This plugin only supports public WebDAV URLs. Some providers offer WebDAV with | ||
OAuth, which is not supported. | ||
|
||
A [Companion](/docs/companion) instance is required for the WebDAV plugin to | ||
work. This saves the user bandwidth, especially helpful if they are on a mobile | ||
connection. You can self-host Companion or get a hosted version with any | ||
[Transloadit plan](https://transloadit.com/pricing/). | ||
|
||
:::note | ||
|
||
Companion has | ||
[Server Side Request Forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery) | ||
(SSRF) protections built-in so you don’t have to worry about the security | ||
implications of arbitrary URLs. | ||
|
||
::: | ||
|
||
<Tabs> | ||
<TabItem value="npm" label="NPM" default> | ||
|
||
```shell | ||
npm install @uppy/webdav | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="yarn" label="Yarn"> | ||
|
||
```shell | ||
yarn add @uppy/webdav | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="cdn" label="CDN"> | ||
<UppyCdnExample> | ||
{` | ||
import { Uppy, WebDav } from "{{UPPY_JS_URL}}" | ||
const uppy = new Uppy() | ||
uppy.use(WebDav, { | ||
// Options | ||
}) | ||
`} | ||
</UppyCdnExample> | ||
</TabItem> | ||
</Tabs> | ||
|
||
## Use | ||
|
||
```js {10-13} showLineNumbers | ||
import Uppy from '@uppy/core'; | ||
import Dashboard from '@uppy/dashboard'; | ||
import WebDav from '@uppy/webdav'; | ||
|
||
import '@uppy/core/dist/style.min.css'; | ||
import '@uppy/dashboard/dist/style.min.css'; | ||
|
||
new Uppy() | ||
.use(Dashboard, { inline: true, target: '#dashboard' }) | ||
.use(WebDav, { companionUrl: 'https://your-companion.com' }); | ||
``` | ||
|
||
## API | ||
|
||
### Options | ||
|
||
<CompanionOptions /> |