Reputation: 1
I'm trying to read some images that are in a zip in dropbox. So I need to access to this file and get the images, but I don't know what i'm doing wrong. I'm doing like this:
string uri_zip = new Uri(string.Format("My Path of the zip in Dropbox")).AbsoluteUri;
using (ZipArchive zip = ZipFile.Open(uri_zip, ZipArchiveMode.Read))
{
foreach (ZipArchiveEntry entry in zip.Entries)
{
images.Add(entry.Name.Substring(0, entry.Name.LastIndexOf(@".")));
}
}
Any solution?
Upvotes: 0
Views: 121
Reputation: 716
If you look at ZipFile.Open it says that the first string argument is "The path to the archive to open, specified as a relative or absolute path." I believe that it doesn't work with the remote, most probably HTTPS URI i.e. it probably won't work with that dropbox URI that you are trying to pass as an argument to the Open() function.
Try to download the file first using HttpClient and then use it from the local file system, or see if the Dropbox API supports working with an archive on the server-side.
Upvotes: 1