I’m currently using version 2.7.4 of the compressor in ASP.NET with latest version of Flexmonster. When I try to read the Stream, it throws a “Path too long error”. The maximum path length supported by Stream (System.IO.Stream) is 260 characters, and I have to make it work with 350+.
Is there any workaround to manage those path lengths? What I’m doing now is downloading the file to another folder of the server, converting it to string, to then read it with “CompressString” instead of’ “CompressFile”, but I would like to know if there’s a better solution to it.
Thanks in advance
Thank you for reaching out to us.
Our team would like to kindly suggest you consider the following: starting with version 4.6.2 of .NET Framework, long paths are supported by default. The runtime throws a PathTooLongException under the following conditions:
In case update to the version 4.6.2+ is undesirable, apps that target the .NET Framework 4.6.1 and earlier but run under the .NET Framework 4.6.2 can enable Flong path support by including the following setting in the
<runtime> element of the application configuration file:
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false" />
More information about the exception and ways to handle it can be found following the link.
Otherwise, our team confirms that the way to transmit the data you have described is the only possible approach in order to avoid the exception.
We hope it works for you.