Skip to content

Commit 59c5b7b

Browse files
author
Konduru Keerthi Konduru Ravichandra Raju
committed
DropBox Cloud Storage
1 parent 5be214f commit 59c5b7b

File tree

2 files changed

+5
-2
lines changed
  • Read-and-Save-document/Open-and-save-Word-document/DropBox-Cloud-Storage

2 files changed

+5
-2
lines changed

Read-and-Save-document/Open-and-save-Word-document/DropBox-Cloud-Storage/Open-Word-document/Open-Word-document/Controllers/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public async Task<MemoryStream> GetDocumentFromDropBox()
7070
//Define the access token for authentication with the Dropbox API
7171
var accessToken = "Access_Token";
7272

73-
//Define the file path in Dropbox where the file is located
73+
//Define the file path in Dropbox where the file is located. For ex: "/Template.docx" or "/Apps/Template.docx"
7474
var filePathInDropbox = "FilePath";
7575

7676
try

Read-and-Save-document/Open-and-save-Word-document/DropBox-Cloud-Storage/Save-Word-document/Save-Word-document/Controllers/HomeController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,16 @@ public async Task<MemoryStream> UploadDocumentToDropBox(MemoryStream stream)
269269
//Define the access token for authentication with the Dropbox API
270270
var accessToken = "Access_Token";
271271

272+
//Define the file path in Dropbox where the file should be saved. For ex: "/Template.docx" or "/Apps/Template.docx"
273+
var filePathInDropbox = "FilePath";
274+
272275
try
273276
{
274277
//Create a new DropboxClient instance using the provided access token
275278
using (var dbx = new DropboxClient(accessToken))
276279
{
277280
//Upload the file to Dropbox
278-
var uploadResult = await dbx.Files.UploadAsync("FilePath", WriteMode.Overwrite.Instance, body: new MemoryStream(stream.ToArray()));
281+
var uploadResult = await dbx.Files.UploadAsync(filePathInDropbox, WriteMode.Overwrite.Instance, body: new MemoryStream(stream.ToArray()));
279282
}
280283
Console.WriteLine("Upload completed successfully");
281284
}

0 commit comments

Comments
 (0)