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

Multiple files uploaded = quadruple backslashes

3 Answers 18 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Ody
Top achievements
Rank 1
Veteran
Ody asked on 09 Dec 2016, 11:41 PM

If I select one file and upload it to .NET as List<HttpPostedFileBase>, the file HttpPostedFIleBase.FileName property, which includes the file's complete path, has what I would expect for escaped strings - double backslashes, for example C:\\FirstDir\\Foo.txt

 

But if I select multiple files and upload them, the files have double double (quadruple) backslashes:  C:\\\\FirstDir\\\\Foo.txt.

 

Is this known? Can anyone confirm?  From what I can tell the full paths are coming from .NET, not JavaScript or Kendo, but I want to be sure.

 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 12 Dec 2016, 09:17 AM

Hello Matt,

We have not met the mentioned behavior on our end. Could you demonstrate it with a small runnable example?

Generally the browsers do not provide the full path to the file on the user's system. Only IE does this by default, but the behavior could be disabled by the user through the browsers settings.

Regards,
Dimiter Madjarov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Ody
Top achievements
Rank 1
Veteran
answered on 14 Dec 2016, 08:04 PM

Sorry, I don't really have time to put together a small project for it.  The test is easy though - create a web project with a simple bit of javascript for a FileUpload.  Create an MVC or Ajax web method, HttpPost, with the signarture like UploadFiles(List<HttpPostedFileBase> files).  Then run it in your debugger.  If you're using IIS Express, your site security is already set to Trusted, which enables the IE option to include the path.

Using the FileUpload control, if you select multiple files from your computer or a network share, there will be twice as many backslashes compared to picking one file.

It's quite possible a company is relying on the ability to upload paths using only IE, which allows that option.

 

Cheers

0
Dimiter Madjarov
Telerik team
answered on 15 Dec 2016, 09:40 AM

Hello Matt,

We were unable to reproduce the issue on our end with the suggested setup. I would suggest to remove the Kendo UI Upload widget and try the upload process with a regular <input type="file" /> element. This way you will be able to isolate the reason for the issue and assure if the Kendo UI Upload is causing the behavior.

Regards,
Dimiter Madjarov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Upload
Asked by
Ody
Top achievements
Rank 1
Veteran
Answers by
Dimiter Madjarov
Telerik team
Ody
Top achievements
Rank 1
Veteran
Share this question
or