Bug Report T302865
Visible to All Users

ASPxHtmlEditor - An image path is constructed incorrectly when the UploadImageFolder property refers to another server path

created 9 years ago

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

Answers approved by DevExpress Support

created 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.

    Comments (3)
    CW CW
    Chris Wollesen 2 9 years ago

      Problem is still occurring even with hotfix.  settings are as below with the exact same error occurring.
      <SettingsDialogs InsertImageDialog-SettingsImageUpload-UploadFolder="\[ServerName]\IISNewsImagesDev\HeaderImages" InsertImageDialog-SettingsImageSelector-CommonSettings-RootFolder="\[ServerName]\IISNewsImagesDev" InsertImageDialog-SettingsImageSelector-RootFolderUrlPath="" InsertImageDialog-SettingsImageSelector-ProviderType="Physical" />

      Artem (DevExpress Support) 9 years ago

        We need additional time to double check this scenario. Please bear with us.

        Anthony (DevExpress Support) 9 years ago

          Hi Chris,

          We've discussed this situation with the R&D team and decided to fix the issue. I've created a separate ticket regarding it: ASPxHtmlEditor - An image with a UNC path cannot be saved on the server.

          created 9 years ago

          Hello Chris,
          I suggest you create a virtual folder in your project and set a path to it using an actual server name. After that, set all necessary properties of ASPxHtmlEditor to the path to the virtual folder.
          Best regards,
          Vova

            Comments (2)
            CW CW
            Chris Wollesen 2 9 years ago

              That isn't really an option for this scenario and I'm confused regarding the inconsistency between controls.  Why would the UNC name work fine for the ASPxFileManager control, but not for the ASPxHTMLControl?  I have no issues with using a UNC name in the ASPxFileManager control.
              Example from ASPxFileManager below:
              <dx:ASPxFileManager ID="fileManager" ClientInstanceName="fileManager" runat="server" Height="384" Width="680" Theme="SoftOrange" >
                 <Settings RootFolder="\[servername]\IISNewsImagesDev" ThumbnailFolder="\[servername]\IISNewsImagesDev"
                     AllowedFileExtensions=".jpg,.jpeg,.gif,.png"
                     InitialFolder="RollUpImages" />
                 <SettingsEditing AllowCreate="true" AllowDelete="true" AllowMove="true" AllowRename="false" AllowCopy="false" AllowDownload="true" />
                 <SettingsPermissions>
                     <AccessRules>
                         <dx:FileManagerFolderAccessRule Role="" Path="Upload" Upload="Allow" />
                     </AccessRules>
                 </SettingsPermissions>
                 <ClientSideEvents SelectedFileChanged="OnSelectedFileChanged" />
              </dx:ASPxFileManager>

              Vova (DevExpress Support) 9 years ago

                Hello Chris,

                Our ASPxFileManager creates the necessary folder structure inside a web-application and generates thumbnail images on the web server side. Every file item on the client side loads a thumbnail image  by a direct URL from the web server. ASPxHtmlEditor does not create any additional folders to store images. The control saves images by the path which is declared in its settings and builds corresponding URL using physical file path. If the storage is removed, this approach leads to incorrect URLs.
                To solve this issue, I can only offer a way with a virtual directory (see the attached project and video) because there is no way to use UNC paths instead of URL.

                Also you may be interested in the following demo, demonstrating way to custom save image in ASPxHtmlEditor: Image Upload Processing.
                Best regards,
                Vova

                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.