Multiple files uploaded = quadruple backslashes

4 posts, 0 answers
  1. Ody
    Ody avatar
    5 posts
    Member since:
    Oct 2016

    Posted 09 Dec 2016 Link to this post

    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.

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2211 posts

    Posted 12 Dec 2016 Link to this post

    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.
  3. Ody
    Ody avatar
    5 posts
    Member since:
    Oct 2016

    Posted 14 Dec 2016 in reply to Dimiter Madjarov Link to this post

    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

  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2211 posts

    Posted 15 Dec 2016 Link to this post

    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.
Back to Top