path & file name limit

User avatar
stuck
Panoramic Lounger
Posts: 8176
Joined: 25 Jan 2010, 09:09
Location: retirement

path & file name limit

Post by stuck »

Today I unzipped a series of PDF files from a single ZIP file. All but two of the PDF files opened without problem. Neither Foxit nor Acrobat would handle these files. However, I could open both of them using Firefox.

It didn't take me long to suspect that as these two files had names that were a little bit longer than all the others, and since all the files were in a folder several folders down in my file hierarchy, the path + file name length of this pair was beyond a Windows limit. Sure enough, moving the two files up a level meant the could be opened with Foxit or Acrobat. Thus by abbreviating the name of the folder holding all the files everything is OK again.

What I find odd is that while Foxit and Acrobat choked on the length of the path + file name, Firefox didn't. So maybe it wasn't a Windows character limit problem after all?

Anyone care to comment?

Ken

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: path & file name limit

Post by HansV »

Have you tried other browsers, and if so, what is the result?

(A very uninformed guess: perhaps Firefox uses a URL to access the file. URLs don't have a length limit - in theory, of course - unlike file paths.)
Best wishes,
Hans

User avatar
stuck
Panoramic Lounger
Posts: 8176
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: path & file name limit

Post by stuck »

HansV wrote:
28 Nov 2023, 19:18
Have yo tried other browsers, and if so, what is the result?

(A very uninformed guess: perhaps Firefox uses a URL to access the file. URLs don't have a length limit - in theory, of course - unlike file paths.)
No I didn't try another browser (the only other one I have is Edge :flee: ).

The idea of URL vs path also crossed my mind. When the files are opened in FF the address bar shows the URL/path in this style:

Code: Select all

file:///[driveLetter]:/[rootFolder]/[subfolder1]/[subfolder2]/[etc...]
Ken

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: path & file name limit

Post by HansV »

Could you try it using Edge?
Best wishes,
Hans

User avatar
stuck
Panoramic Lounger
Posts: 8176
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: path & file name limit

Post by stuck »

Since you asked so nicely, I took a deep breath and held my nose...

'Open with... Edge is an option but the PDF doesn't open, absolutely nothing happens! (apart from the usual MS barrage trying to get me to make Edge my default browser) :laugh:

Meanwhile, I've discovered that Affinity Photo can open the file, despite it being a regular Windows application and thus you'd expect it to be limited by the long pathname :scratch:

I suppose that might point the finger at something in the the way these two files were originally created as PDFs, compared to the rest of the PDFs in the ZIP, but I doubt it. Each file is the next chapter in a book so I'd expect them all to have been created in the same way at the same time.

However since the simple tweak of shortening the folder name that holds all the PDFs fixes the problem, I'm going to file this one under #WindowsWeirdnessLostCountAgain and move on.

Thanks,

Ken

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: path & file name limit

Post by HansV »

Thanks for testing. I agree with your conclusion...
Best wishes,
Hans

Mico
NewLounger
Posts: 13
Joined: 02 Oct 2020, 08:09

Re: path & file name limit

Post by Mico »

stuck wrote:
29 Nov 2023, 12:13
Since you asked so nicely, I took a deep breath and held my nose...

'Open with... Edge is an option but the PDF doesn't open, absolutely nothing happens! (apart from the usual MS barrage trying to get me to make Edge my default browser) :laugh:

Meanwhile, I've discovered that Affinity Photo can open the file, despite it being a regular Windows application and thus you'd expect it to be limited by the long pathname :scratch:

I suppose that might point the finger at something in the the way these two files were originally created as PDFs, compared to the rest of the PDFs in the ZIP, but I doubt it. Each file is the next chapter in a book so I'd expect them all to have been created in the same way at the same time.

However since the simple tweak of shortening the folder name that holds all the PDFs fixes the problem, I'm going to file this one under #WindowsWeirdnessLostCountAgain and move on.

Thanks,

Ken
Ok, I kinda got the same issue with an old PDF, and after i red this, I gave up on restoring or opening it ever again. Sadly