1

I am using REST API v1 in getting the orders. This is the URL i've passed:

www.xxx.com.au/wc-api/v1/orders?filter%5Blimit%5D=2000&oauth_consumer_key=ck_f21cdxxxdca2370421791b6414e7efa974c7da31&oauth_timestamp=1478485935&oauth_nonce=8A4FC4E3EF48D6AF0C00580FDFA6BCAB6BB77E55&oauth_signature_method=HMAC-SHA256&oauth_signature=dosA4Lz7Yjw8g%2bElzQYBZQprGhwMrGHtLGU2usOk6F8%3d

but unfortunately, I've got this error:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I am using c# ASP.NET.

Jen143
  • 815
  • 4
  • 17
  • 42
  • Your URL is too long which can't be processed by server. Can you try to shorten it? – Pratik Gaikwad Nov 07 '16 at 03:03
  • What do you mean by shorten the URL? do i need to remove some parameters like the oauth_nonce or oauth_signature_method ? – Jen143 Nov 07 '16 at 03:06
  • please count the characters in URL, they will be more than 260. That's why the error. I guess, you will have to send parameters by some alternate method such as Post or form submission. – Pratik Gaikwad Nov 07 '16 at 03:09

1 Answers1

1

Zeta Long Paths library is to deal with long file names when accessing files and folders and it also provides several classes and functions to perform basic functions on file paths and folder paths that are longer than the "MAX_PATH" limit of 260 characters.

var folderPath = new ZetaDirectoryInfo(YourLongURL);

foreach ( var filePath in folderPath.GetFiles() )
{
    Console.Write( "File {0} has a size of {1}", 
        filePath.FullName, 
        filePath.Length );
}

You can also have a look at path too long exception

Community
  • 1
  • 1
Mohit S
  • 13,723
  • 6
  • 34
  • 69