cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DownloadAsync error

DownloadAsync error

rhernandez8305
Helpful | Level 6
Go to solution

I tried download all folders/files from DropBox.Api but I received this error:

 

Value should match pattern '\A(?:(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?))\z'
Parameter name: path

 

My code is:

 

using (var response = await dbx.Files.DownloadAsync("/folder/File.ext" ))
                        {
                           //code
                        }

 

Thanks a lot!!!

1 Accepted Solution

Accepted Solutions

rhernandez8305
Helpful | Level 6
Go to solution

Thanks for your reply, I resolved it. This is part of my code:

I get the "PathLower" property from the metadata's files:

the path's format  is: "/folder/MyFile.ext"

 

using (var dbx = new DropboxClient("KeyApi"))
            {
                var list = await dbx.Files.ListFolderAsync(string.Empty, recursive: true);

                foreach (var item in list.Entries.Where(i => i.IsFile))
                {
                    string urlFile = item.AsFile.PathLower;
                    using (var response = await dbx.Files.DownloadAsync(urlFile))
                    {
                        //code
                    }
                }
            }

 

Thanks a lot.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution
That error is indicating that the `path` value you supplied doesn't match the expected format. The value "/folder/File.ext" would match, but it looks like that's just an example. Can you share the exact value you're supplying when you get this error?

For example, if you're supplying a file path, make sure it starts with a "/".

rhernandez8305
Helpful | Level 6
Go to solution

Thanks for your reply, I resolved it. This is part of my code:

I get the "PathLower" property from the metadata's files:

the path's format  is: "/folder/MyFile.ext"

 

using (var dbx = new DropboxClient("KeyApi"))
            {
                var list = await dbx.Files.ListFolderAsync(string.Empty, recursive: true);

                foreach (var item in list.Entries.Where(i => i.IsFile))
                {
                    string urlFile = item.AsFile.PathLower;
                    using (var response = await dbx.Files.DownloadAsync(urlFile))
                    {
                        //code
                    }
                }
            }

 

Thanks a lot.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    rhernandez8305 Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?