Compress contents in directory to zip from parent directory and place that zip in same parent directory

  • 1
  • Question
  • Updated 1 week ago
In parent directory there are few child directories, I want all child subdirectories to be zipped in a zip file and place the zip file in same parent directory
Photo of Kunal Trivedi

Kunal Trivedi

  • 3 Posts
  • 0 Reply Likes

Posted 1 week ago

  • 1
Photo of Kunal Trivedi

Kunal Trivedi

  • 3 Posts
  • 0 Reply Likes
Help me with the ASAP please
Photo of Nick Nicholls

Nick Nicholls, Employee

  • 21 Posts
  • 2 Reply Likes
You will have to first download the zip, and then upload it.

To download the zip, make a request like:
POST /sf/v3/Items(<parentFolderId>)/BulkDownload?redirect=True

["<subFolder1>","<subFolder2>", <etc>]


If you are using something like the C# SDK, it would look like:
var stream = await ShareFileClient.Items.BulkDownload(parent.url, parentChildren.Feed.Select(i => i.Id)).ExecuteAsync();


That stream is a "zip" file. You can then upload it to that parent directory. For upload examples, see our documentation site https://api.sharefile.com/rest/guides/usecases.aspx