I keep receiving the 'URL upload not supported for OneDrive business' error when passing a dataUri option to OneDrive.save().
The documentation says data URI works for OneDrive business, so this error seems to counter that.
For context, I am wanting to save a .txt/.rtf file created from an online text editor to OneDrive, so I don't have access to using input type=file, I can only upload either as a URL to the .txt/.rtf file or a data URI.
Thank you for your contribution to OneDrive API Docs. We will be triaging your incoming issue as soon as possible.
OneDrive Business does not support the service that OneDrive Personal provides whereby you can give it an arbitrary, internet accessible, URL and it'll be downloaded to your drive. It should, however, support being provided with a data URI.
It may be that the picker is applying the restriction for the former on the latter.
@ClaroJack, can you provide your Picker configuration options used or better yet a repro branch for us to debug?
cc: @aditima @margoflynn
Here is the function I am executing,
OneDrive.save({
clientId: 'MY_CLIENT_ID',
action: 'save',
sourceUri: 'data:' + mimeType + ';charset=utf-8;base64,' + btoa(content),
fileName: filename,
})
Has there been an update on this? I still get this error when passing a data URI in sourceUri.
Clarojack - any resolution? Seeing the same thing here...
Bump I am getting the same thing. Data uri not web url.
Even me, I m getting the same issue....found no solution anywhere
I was able to get around this by removing the offending API check. See my commit here.
This seems to work okay for me, but there's no guarantee it doesn't break other things. Obviously an official fix would be preferred here. Until then, here's the CDN URL if you want to use my fork:
<script src="https://cdn.jsdelivr.net/gh/sweetgiorni/onedrive-file-picker@26b28ba/OneDrive.js"></script>