What is the 'hidden' limit on file name le

2019-06-14 11:15发布

问题:

I have a FileUpload control, and when I select the file

'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.txt'

, (which I can create in Windows with no problem), it is saying that it does not have a file when I postback.

It works fine for smaller file names. What's going on?

回答1:

This could happen if you try to save the file in a folder on the server side (like a temp folder in c:\documents and settings\blabla...\temp) and exceed the MAX_PATH limit of 255 characters while on the client the file is located at the root and MAX_PATH is not reached.



回答2:

For windows it is 255 characters including the complete filepath.