mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
22 lines
531 B
JavaScript
22 lines
531 B
JavaScript
export default (client) => {
|
|
return {
|
|
uploadFile(file, onUploadProgress = function () {}, cancelToken = null) {
|
|
const formData = new FormData()
|
|
formData.append('file', file)
|
|
|
|
const config = {
|
|
cancelToken,
|
|
onUploadProgress,
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data',
|
|
},
|
|
}
|
|
|
|
return client.post('/user-files/upload-file/', formData, config)
|
|
},
|
|
uploadViaURL(url) {
|
|
return client.post('/user-files/upload-via-url/', { url })
|
|
},
|
|
}
|
|
}
|