Open Excel docs where full path in longer than 260 characters => does not work

Hi Aspose team,

during processing of documents (in this case XLSx) I am hitting limit that documents that are with long path cannot be opened due to:

"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."

Considering that there are some libraries which can process long path (for example, AlphaFS => http://alphafs.alphaleonis.com/) it will be great that you extend also Aspose components to be able to go around this crazy Windows limitation as this is certainly possible.
Can you please check?

Thanks,
Oliver

Hi Oliver,


Thank you for contacting Aspose support.

Please note, the max path limit is imposed by the Windows API and not by Aspose.Cells API. Let me quote the MSDN article here for your reference.

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is “D:\some 256-character path string” where “” represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
Hi Babar,

there is a workaround (provided over Tasks and OneNote forum):

// using the AlphaFS library to load the file
FileStream fs = Alphaleonis.Win32.Filesystem.File.OpenRead("path to file");

// Load the document into Aspose.Note.
// Has to be replaced with appropriate Aspose component
Document oneFile = new Document(fs);

I just tested and that worked :-).

BR,
Oliver

Hi Oliver,

Thanks for your feedback and using Aspose.

It is good to know that you were able to sort out this issue. Let us know if you encounter any other issue, we will be glad to look into it and help you further.