Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Problem retrieving images using WSI

  1. #1
    glennewing is offline Junior Member
    Join Date
    Oct 2005
    Posts
    15

    Default Problem retrieving images using WSI

    I am testing using a stock ML64 v9.0.1.3 using the stock test data in a local development environment. My initial development of a SOAP client to connect to WSI went well until I attempted to retrieve product info that included images. By tracing I discovered that in AspDotNetStorefrontWSI.GetImageData() the correct image URL is returned by AppLogic.LookupImage but CommonLogic.SafeMapPath just returns that URL rather than converting it to a physical path because the Path.IsPathRooted test at the beginning of SafeMapPath returns true.

    The result from WSI: <Error Message="Exception, Message=Could not find a part of the path 'c:\images\Product\icon\4.jpg'." />

    The Path.IsPathRooted test use is beyond my understanding if SafeMapPath is intended to return a physical path. (But getting beyond my understanding is a very short journey indeed!)

    I have submitted a support ticket but how about some help from some of you other folk who forgot that holiday weekends are for something other than banging out code.

  2. #2
    glennewing is offline Junior Member
    Join Date
    Oct 2005
    Posts
    15

    Default

    In order to keep moving ahead while I await official word, I have changed the code in WSI.cs GetImageData

    from:

    if (ImageUrl.Length != 0) {FN = CommonLogic.SafeMapPath(ImageUrl);}

    to:

    if (ImageUrl.Length != 0) {FN = CommonLogic.SafeMapPath(ImageUrl);
    if (FN == ImageUrl) {FN = CommonLogic.SafeMapPath("~" + ImageUrl);}}

    This works and, for a bandaid, seems safe.

  3. #3
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Glenn, I got your ticket in support and responded to it. This solution seems to work fine for me as well when I tested it here. I've logged this into our bug tracking system also to be updated in the build.

    Thanks for posting!