title: "Uppy 1.26: Dashboard “disabled”, per-file headers" date: 2021-02-26 author: arturi image: "https://uppy.io/images/blog/1.26/dashboard-disabled.jpg"
Uppy 1.26 brings a new disabled
option for the Dashboad, ability to set headers per file with XHR Upload, and fixes for the Transloadit plugin.
You can now specify a disabled
option for the Dashboard, in order to make it non-interactive and grayed out. Users won’t be able to click on buttons or drop files.
This is useful when you need to confitionally enable/disable file uploading or manipulation, based on a condition in your app.
Your browser does not support the video tag: https://uppy.io/images/blog/images/blog/1.26/dashboard-disabled-vs-enabled.mp4This option can be set on init:
uppy.use(Dashboard, {
disabled: true,
})
and via API:
const dashboard = uppy.getPlugin('Dashboard')
dashboard.setOptions({ disabled: true })
userNameInput.addEventListener('change', () => {
dashboard.setOptions({ disabled: false })
})
@uppy/xhr-upload
now accept a headers: (file) => {}
function, so you can do:
uppy.use(XHRUpload, {
headers: file => ({
'authorization': `bearer ${global.userToken}`,
'header-name': file.meta.someMetaValue,
}),
})
to determine file-specific headers.
The function syntax for headers
is only available if the bundle
option is false
(the default). bundle
uploads share only one set of headers.
33e656cad3
/ @goto-bus-stop)See changelog for details.