uppy README

The project's README from github.com/transloadit/uppy. As one markdown file: README.md.

Uppy uppy on npm

Uppy logo: a smiling puppy above a pink upwards arrow

Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. It’s fast, has a comprehensible API and lets you worry about more important problems than building a file uploader.

Read the docs | Try Uppy

Developed by Transloadit

Uppy is being developed by the folks at Transloadit, a versatile API to handle any file in your app.

TestsCI status for Uppy testsCI status for Companion tests
DeploysCI status for CDN deploymentCI status for Companion deploymentCI status for website deployment

Example

Code used in the above example:

import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import RemoteSources from '@uppy/remote-sources'
import ImageEditor from '@uppy/image-editor'
import Webcam from '@uppy/webcam'
import Tus from '@uppy/tus'

const uppy = new Uppy()
  .use(Dashboard, { trigger: '#select-files' })
  .use(RemoteSources, { companionUrl: 'https://companion.uppy.io' })
  .use(Webcam)
  .use(ImageEditor)
  .use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
  .on('complete', (result) => {
    console.log('Upload result:', result)
  })

Try it online or read the docs for more details on how to use Uppy and its plugins.

Integrations

Uppy has first-class support for plain JS/HTML, React, Svelte, Vue, and Angular.

For the supported frameworks (except Angular) Uppy offers three ways to build user interfaces:

  1. Pre-composed, plug-and-play components. Mainly <Dashboard />. The downside is that you can’t customize the UI.
  2. Headless components. Smaller components, easier to override the styles or compose them together with your own components.
  3. Hooks. Attach our logic to your own components, no restrictions, create a tailor-made UI.

Features

Installation

npm install @uppy/core @uppy/dashboard @uppy/tus

Add CSS uppy.min.css, either to your HTML page’s <head> or include in JS, if your bundler of choice supports it.

Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Smart CDN. In that case Uppy will attach itself to the global window.Uppy object.

⚠️ 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.

<!-- 1. Add CSS to `<head>` -->
<link
  href="https://releases.transloadit.com/uppy/v6.0.1/uppy.min.css"
  rel="stylesheet"
/>

<!-- 2. Initialize -->
<div id="files-drag-drop"></div>
<script type="module">
  import {
    Uppy,
    Dashboard,
    Tus,
  } from 'https://releases.transloadit.com/uppy/v6.0.1/uppy.min.mjs'

  const uppy = new Uppy()
  uppy.use(Dashboard, { target: '#files-drag-drop' })
  uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
</script>

Documentation

Plugins

UI Elements

Sources

The ⓒ mark means that @uppy/companion, a server-side component, is needed for a plugin to work.

Destinations

File Processing

Miscellaneous

Browser Support

We aim to support recent versions of Chrome, Firefox, and Safari.

FAQ

Why not use <input type="file">?

Having no JavaScript beats having a lot of it, so that’s a fair question! Running an uploading & encoding business for ten years though we found that in cases, the file input leaves some to be desired:

Not all apps need all these features. An <input type="file"> is fine in many situations. But these were a few things that our customers hit / asked about enough to spark us to develop Uppy.

Why is all this goodness free?

Transloadit’s team is small and we have a shared ambition to make a living from open source. By giving away projects like tus.io and Uppy, we’re hoping to advance the state of the art, make life a tiny little bit better for everyone and in doing so have rewarding jobs and get some eyes on our commercial service: a content ingestion & processing platform.

Our thinking is that if only a fraction of our open source userbase can see the appeal of hosted versions straight from the source, that could already be enough to sustain our work. So far this is working out! We’re able to dedicate 80% of our time to open source and haven’t gone bankrupt yet. :D

Does Uppy support S3 uploads?

Yes, please check out the docs for more information.

Can I use Uppy with Rails/Node.js/Go/PHP?

Yes, whatever you want on the backend will work with @uppy/xhr-upload plugin, since it only does a POST or PUT request. Here’s a PHP backend example.

If you want resumability with the Tus plugin, use one of the tus server implementations 👌🏼

And you’ll need @uppy/companion if you’d like your users to be able to pick files from Google Drive, Dropbox or via direct URLs (with more services coming).

Contributions are welcome

Used by

Uppy is used by: Photobox, Issuu, Law Insider, Cool Tabs, Soundoff, Scrumi, Crive and others.

Use Uppy in your project? Let us know!

Contributors

contributors table

License

The MIT License.

uppy (transloadit/uppy)

Searching Database…

31K ·GitHub
这是什么?Uppy 是一个简洁、模块化的 JavaScript 文件上传库,用于网页浏览器:它可以从磁盘、摄像头或云端服务选取文件,进行预览,然后上传到你的后端,之后还可以选择进行后续处理。
Uppy 是托管服务,还是我要加到自己代码里的东西?它是一个开源(MIT 协议)的 JavaScript 库,打包进你的应用中使用,核心采用轻量的插件式架构。它还有一个可选的服务端组件 @uppy/companion,用于从云服务商导入文件。
我该怎么把它加到项目里?通过 npm/yarn 在你的打包工具中安装 @uppy 软件包并引入 uppy.min.css,或者直接使用预先构建好的 CDN 整合包,它会挂载到 window.Uppy——不过 CDN 整合包不建议在生产环境使用,因为它包含了几乎所有插件。
我的服务器上需要什么特别的东西吗?不需要——@uppy/xhr-upload 只是发送一个 POST 或 PUT 请求,所以 Rails、Node、Go、PHP 或任何后端都可以。要支持断点续传,就运行某个 tus 服务器实现;只有从云端导入文件时才需要 @uppy/companion。
浏览器方面有什么我该注意的地方?它面向较新版本的 Chrome、Firefox 和 Safari,所以不支持老旧浏览器。上传前可以编辑元信息、裁剪图片,并且内置了国际化和无障碍支持。
相比普通的文件选择框,用这个有什么好处?Uppy 提供断点续传功能,即使断网、浏览器崩溃或误操作跳转页面,上传也不会丢失;它还有精确的进度显示、在客户端校验文件大小/类型/数量、调用摄像头拍摄,以及直接从 Dropbox 或 URL 选取文件——不用先把文件下载到手机上。
@uppy/companion 是做什么的?它是一个服务端组件,让 Uppy 可以从 Google Drive、Dropbox、Box、Facebook、OneDrive 和直接 URL 导入文件,并在服务器之间同步,这样远程文件直接传到目的地,不用经过用户的设备中转。
Golden Retriever 是什么?一个可选的 Uppy 插件,能在浏览器崩溃后恢复文件,让正在进行的上传不会丢失。它与大文件传输的 tus 断点续传功能是互补的。
Size
447.7 MB
Stars
31K
Age
10y
Commits · 90 Days