Bug Report T309685
Visible to All Users

ASPxHtmlEditor - An image with a UNC path cannot be saved on the server

created 9 years ago

[DevExpress Support Team: CLONED FROM T302865: ASPxHtmlEditor - An image path is constructed incorrectly when the UploadImageFolder property refers to another server path]
In trying to set to UploadImageFolder setting on the ASPxHTMLEditor it will not accept a UNC path.  it instead appends the entered path onto the web root path which results in an invalid path and a "path not found error"
.aspx code below (obviously [servername] is replaced with actual server name in my code)
<dx:ASPxHtmlEditor Enabled="true" ID="htmlHeader" Theme="SoftOrange" Width="100%" Height="240px" runat="server" EnableTheming="true">

<SettingsImageSelector  EditingSettings-TemporaryFolder="\[servername]\IISNewsImagesDev\Temp" CommonSettings-UseAppRelativePath="false" CommonSettings-RootFolder="\[servername]\IISNewsImagesDev" CommonSettings-ThumbnailFolder="\[servername]\IISNewsImagesDev" CommonSettings-InitialFolder="HeaderImages" />
<SettingsImageUpload  UploadImageFolder="\[servername]\IISNewsImagesDev"  />
</dx:ASPxHtmlEditor>

When I go to upload an image this is the error I get…
Could not find a part of the path 'C:\Workspaces\CMS-IISNews\CMS-News\Dev\CMS_IISNews\CMS_IISNews\[servername]\IISNewsImagesDev\wwa5kpwh.jpg'.

Looking forward to reply.
Chris Wollesen

Comments (1)
Anthony (DevExpress Support) 9 years ago

    Hi Chris,

    I've reproduced this issue and forwarded it to our developers for further investigation. We will update this report once any news regarding this subject is available.
    For now, it is possible to either use a virtual folder as described in ASPxHtmlEditor - An image path is constructed incorrectly when the UploadImageFolder property refers to another server path or save an image manually using the ImageFileSaving event.

    Answers approved by DevExpress Support

    created 9 years ago (modified 9 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Additional information:

    We have provided the new UploadFolderUrlPath property that specifies the relative URL path to an upload folder whose physical path is defined by the UploadFolder property.
    For MVC framework, we have implemented the new SaveUploadedFile method overload accepting the uploadFolderUrlPath string as a parameter.
    Note that non-local web pages cannot access local files (specified like file://) in any modern web browser. To make a file available from the web, implement your own handler that returns a requested file. Then, you can set the UploadFolderUrlPath property in the following manner.

    C#
    UploadFolderUrlPath = "http://yourserver/yourapp/yourhandler.ashx?="

    In this case, the file will be resolved as

    C#
    "http://yourserver/yourapp/yourhandler.ashx?=recentlyUploadedImage.jpg"

    Note that the specified links will be available with the 15.2 documentation release.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.