Closed sittingInFront closed 4 years ago
You want to reference the folder you want to upload to, not the file you are replacing. The default behavior is to overwrite the existing file I believe.
Thank you for help. It works.
Can you write how I can create the request to open upload session like I saw in MS Graph API
POST /me/drive/items/{itemId}/createUploadSession
itemId = existfileID?
You will need to use the DriveItemUploadableProperties
item to include this information. Unfortunately, this is not one of the prepopulated properties that you can set, so you will need to use the AdditionalDataManager
:
DriveItemUploadableProperties properties = new DriveItemUploadableProperties();
AdditionalDataManager mgr = properties.getAdditionalDataManager();
mgr.put("@microsoft.graph.conflictBehavior", new JsonPrimitive("rename"));
@cbales Can you write me some example to resumable upload existing file by ID?
Your posted code above in conjunction with the Additional data in DriveItemUploadableProperties that I posted will work for a file by ID or a folder. However, when trying to run this code for you, I just realized there are two bugs in the SDK that are preventing you from being able to do this:
@
is treated as transient and is not serializedI will work on getting these fixes added to the SDK.
Thank you for the answer. I am looking forward when you fix it.
Hi @cbales! Can you write some terms when you plan to fix this bag?
It is not currently scheduled but it should be out in the next release of the SDK.
this issue also in the .net sdk
I want to upload new content to exist file. Before I need to create UploadSession. I use code below:
but I have an error 400 bad request.
What's wrong in my code?
UPD: When I use code below I have downloaded a new file with name "existFileID"(((
How to upload new version of exist file?