Closed NLLAPPS closed 4 years ago
To accomplish this, you will want to use Resumable Upload. There is currently no example in the SDK, but you will want to use createUploadSession
on your item and create a new ChunkedUploadProvider
to process your request in chunks.
In pseudocode:
DriveItemUploadableProperties props = new DriveItemUploadableProperties();
// Set file name, size, etc.
client.getMe().getDrive().getRoot().getItemWithPath("me.png").createUploadSession(props).buildRequest().post();
ChunkedUploadProvider provider = new ChunkedUploadProvider<T>(session, client, stream, size, class);
provider.upload(options, callback, configs);
Thank you. I'll try. While ı have you, there seems to be a lot of different ads related to OneDrive and authentication.
As I understand from what I have read so far it they graph sdk is the way forward. Is that correct?
Yes, that is what we are recommending. However, we are not yet at full parity with Azure AD, so I would verify in the Graph docs that your scenarios are supported. We should be near or at parity with OneDrive.
@NLLAPPS In case it helps, here's the commit in the .Net client library where we implemented large file uploads. https://github.com/microsoftgraph/msgraph-sdk-dotnet/commit/7c037cf15413b73d1ad7b52ee027a703f4b63be1#diff-374daffefc443a2b383da1d332b730c6
Cheers, it should not be too card to convert
On 7 December 2017 17:52:27 GMT+00:00, "Caitlin Bales (MSFT)" notifications@github.com wrote:
Yes, that is what we are recommending. However, we are not yet at full parity with Azure AD, so I would verify in the Graph docs that your scenarios are supported.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/microsoftgraph/msgraph-sdk-android/issues/70#issuecomment-350044326
Hi guys, I am not sure if I am doing this right. ChunkedUploadProvider.upload is a blocking method that runs on main thread with callback.
How would one use an AsyncTask or another thread while waiting for the call back. The only way I can think of is to block the AysncTask with another variable within the task that changes according to IProgressCallback result.
Wouldn't it be simpler if ChunkedUploadProvider.upload done on another thread?
Any feedback about the above issue?
Anyone? @cbales @MIchaelMainer
Hi @cbales , I was able to create ChunkedUploadProvider but I'm having error when I tried the upload function. May I know what is the int configs parameter? Maybe you can provide a sample snippet of this function. Your help is much appreciated. @_@
@PAYong finally,how you make it work? about uploading large file with microsoft api. I got the same problem
Any updates to this issue?
I would like to know how to upload file by using CreateUploadSession from msgraph-sdk-android OneDrive SDK.
Hi, is there any sample for uploading large files? There is this sample
client.getMe() .getDrive() .getRoot() .getItemWithPath("me.png") .getContent() .buildRequest() .put(file, callback);
As you would imagine, it would be trouble some to
put
large files. How would one achieve that? Thanks.