OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

AzureFileSystem abstraction no longer works because of incorrectly separated relative paths #3332

Closed orchardbot closed 9 years ago

orchardbot commented 11 years ago

@DanielStolt created: https://orchard.codeplex.com/workitem/19503

When using the Media admin UI in the dashboard on the MediaPicker UI while the AzureFileSystem abstraction (which uses Azure Blob Storage) is in effect, one doesn't get far.

Exceptions occur for almost every operation. The cause is that paths are constructed with backslash separators instead of forward slash separators, and those paths are sent directly Azure Blob Storage which then reacts badly.

I think the MediaPicker and MediaService were initially smart enough to not assume a file system when it constructs relative paths. But somewhere along the way someone started assuming (making an ASS out of U and ME), and I guess nobody used CloudService deployment after that.

I have fixed this in AzureFileSystem by simply cleaning up any incoming relative paths supplied to it. Attached you will find the changed AzureFileSystem.cs file. I would like to have it included in the 1.x branch as soon as possible.

orchardbot commented 11 years ago

@sebastienros commented:

Fixed in changeset 787f759ee95b

orchardbot commented 10 years ago

@sfmskywalker commented:

Fixed in changeset c2ef1f3baf8ad59540ad3e58bf9746d735599288