Import from URL
The @uppy/url plugin allows users to import files from the internet. Paste any
URL and it will be added!
Try out the live example or take it for a spin in CodeSandbox.
When should I use this?
When you want to let users import files any URL.
A Companion instance is required for the URL 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.
Companion has Server Side Request Forgery (SSRF) protections build-in so you don’t have to worry about the security implications of arbitrary URLs.
- NPM
- Yarn
- CDN
npm install @uppy/url
yarn add @uppy/url
The bundle consists of most Uppy plugins, so this method is not recommended for production, as your users will have to download all plugins when you are likely using only a few.
It can be useful to speed up your development environment, so don't hesitate to use it to get you started.
<!-- 1. Add CSS to `<head>` -->
<link href="https://releases.transloadit.com/uppy/v3.13.1/uppy.min.css" rel="stylesheet">
<!-- 2. Initialize -->
<div id="uppy"></div>
<script type="module">
import { Uppy, Url } from "https://releases.transloadit.com/uppy/v3.13.1/uppy.min.mjs"
const uppy = new Uppy()
uppy.use(Url, {
// Options
})
</script>
Use
Using @uppy/url only requires setup in Uppy.
Use in Uppy
import Uppy from '@uppy/core';
import Dashboard from '@uppy/dashboard';
import Url from '@uppy/url';
import '@uppy/core/dist/style.min.css';
import '@uppy/dashboard/dist/style.min.css';
new Uppy().use(Dashboard, { inline: true, target: '#dashboard' }).use(Url, {
target: Dashboard,
companionUrl: 'https://your-companion.com',
});
Use in Companion
Companion supports this plugin out-of-the-box so integration is required on this side.
API
Options
id
A unique identifier for this plugin (string, default: 'Url').
title
Title / name shown in the UI, such as Dashboard tabs (string, default:
'Url').
target
DOM element, CSS selector, or plugin to place the drag and drop area into
(string or Element, default: null).
companionUrl
URL to a Companion instance (string, default: null).
companionHeaders
Custom headers that should be sent along to Companion on
every request (Object, default: {}).
companionAllowedHosts
The valid and authorised URL(s) from which OAuth responses should be accepted
(string or RegExp or Array, default: companionUrl).
This value can be a string, a RegExp pattern, or an Array of both. This is
useful when you have your Companion running on several hosts.
Otherwise, the default value should do fine.
companionCookiesRule
This option correlates to the
RequestCredentials value
(string, default: 'same-origin').
This tells the plugin whether to send cookies to Companion.
locale
export default {
strings: {
pluginNameUrl: 'Url',
},
};

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
