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 8 of 8

Thread: Upload Product Image via WSI

  1. #1
    acqy is offline Junior Member
    Join Date
    Jan 2010
    Posts
    14

    Default Upload Product Image via WSI

    Hello,
    Am I able to create a product along with its small/medium/large images via WSI? How can I do that?

  2. #2
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Yes you can, the image would need to be Base64 encoded.

  3. #3
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Here is a small snippet of what it would look like. Note that the content in the Images element is not complete, the Base64 encoding takes quite a bit of space.

    Code:
    <AspDotNetStorefrontImport Version="7.1" AutoLazyAdd="true" AutoCleanup="true" Verbose="true" TransactionsEnabled="true"><Transaction><Product Action="Add" EnsureDefaultVariant="True">
    <Name>My Name</Name>
    <Description>My Description</Description>
    <FroogleDescription>Froogle Description</FroogleDescription>
    <SE>
    <SEName/>
    <SETitle>My Title</SETitle>
    <SEKeywords>My keywords</SEKeywords>
    <SEDescription>SE Description</SEDescription>
    </SE>
    <ProductType Name="Generic Product"/>
    <TaxClass Name="Goods"/>
    <Display>
    <XmlPackage>product.variantsindropdown.xml.config</XmlPackage>
    <ColWidth>4</ColWidth>
    <PageSize>20</PageSize>
    </Display>
    <Images UseAppConfigs="true">
    <Large Extension="jpg" UseAppConfigs="true">
    /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwM
    DAwMEAwODxAPDgwTExQUExMcGxsbHCAgICAgICAgICD/2wBDAQcHBw0MDRgQEBgaFREVGiAgICAg .....
    </Images>
    .
    .
    .
    .

  4. #4
    acqy is offline Junior Member
    Join Date
    Jan 2010
    Posts
    14

    Default

    great reply, but how can i get the base64 encrypted value?

  5. #5
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    What are you using to create the xml file to be uploaded? I personally used a Java app and just used the base64 encoding included with the jdk.

  6. #6
    acqy is offline Junior Member
    Join Date
    Jan 2010
    Posts
    14

    Default

    Ok, and you mean that we just need to encode the image into base64 regardless which tool is using, right?

  7. #7
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Yep thats correct, like I said I used a java app but you could do it in any language, Base64 is Base64 the world around.

  8. #8
    acqy is offline Junior Member
    Join Date
    Jan 2010
    Posts
    14

    Smile

    Great! Thanks man!