This is a migrated thread and some comments may be shown as answers.

Filename + File path limit 255/260

8 Answers 752 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Samir Gulrajani
Top achievements
Rank 2
Samir Gulrajani asked on 15 May 2012, 06:58 PM
As per the post in this discussion:
http://www.telerik.com/community/forums/aspnet/upload/is-there-a-max-filename-length.aspx 

"The limit of 255 characters for Windows XP or 260 character limit for Windows Vista applies to the entire filepath and not just the filename"

How can I check that on client side, and inform the clients that the filename along with file path is too long?

8 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 May 2012, 07:46 AM
Hello Samir,

IE 6 & 7 are the only browsers that return the full path to the file. All other browsers including IE8 return only the file name. With reference to this forum thread, it is not possible to obtain the  file path on the client due to security reasons. In order to craft the serverside path for saving files you can use the following code.
string fullPath = Path.Combine(Server.MapPath("Your upload folder"), uploadedFile.GetName());

Thanks,
Princy.
0
Samir Gulrajani
Top achievements
Rank 2
answered on 16 May 2012, 04:06 PM
So, the limitation of 255/260 characters in full file name + path, is from server side and not client side?  In other words, if I can make sure - on the server side the path + filename does not exceed 255 characters, I should be good.  And even if clients try to upload files where the file path might be huge, but file name is small it should not be a problem.
Example: 
    Client side:
                file path (250characters) + filename (20characters)
    Server side:
                file path (50 characters) + filename (20 characters)

The above scenario will be fine, even now.  Is that true?

0
Genady Sergeev
Telerik team
answered on 18 May 2012, 05:56 PM
Hello Samir,

This is correct, the client-side name can be longer than 255 symbols, however, when saving to the serve one must truncate it to 255 symbols at max.

Kind regards,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Saravanan Gopal
Top achievements
Rank 1
answered on 29 Sep 2015, 08:58 AM

Hi

I using Radasyncupload . I am not able to upload more then 130 character file name .i am getting 414 error please help me.i need to upload 260 character file.Waiting for your quick reply

 

0
Saravanan Gopal
Top achievements
Rank 1
answered on 29 Sep 2015, 11:26 AM
Hi
I using Radasyncupload . I am not able to upload more then 130 character file name .i am getting 414 error please help me.i need to upload 260 character file.Waiting for your quick reply

0
Saravanan Gopal
Top achievements
Rank 1
answered on 01 Oct 2015, 10:17 AM
Hi
I using Radasyncupload . I am not able to upload more then 130 character file name .i am getting 414 error please help me.i need to upload 260 character file.Waiting for your quick reply
0
Tom
Top achievements
Rank 1
answered on 20 May 2020, 07:34 AM
I would suggest to use Long Path Tool program. It resolves problem regarding source path too long.
0
Peter Milchev
Telerik team
answered on 22 May 2020, 01:20 PM

Meanwhile, you can also vote for this feedback portal item:

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
AsyncUpload
Asked by
Samir Gulrajani
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Samir Gulrajani
Top achievements
Rank 2
Genady Sergeev
Telerik team
Saravanan Gopal
Top achievements
Rank 1
Tom
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or