November Happy Hour will be moved to Thursday December 5th.

Image Vault questions

Vote:
 

I have 2 image vault questions, hope it is ok to post them here.

When I try to set the image property on a page (ImageVaultImage) programmatically I can see the image on the page, but it is not visible in edit mode. Can I set the property so that the image shows in the thumbnail in edit mode?

Page.Property["Image"].Value = pathToImageVaultImage;

 

How do you save an image to Image vault from an url? I have used the IVDataFactory.UploadFile, but it only takes HttpPostedFile and FileInfo.

#46700
Dec 28, 2010 10:49
Vote:
 

Do you create a writable clone of the page and saves it back to EPiServer?

The following code does what you want to do.

            var page = CurrentPage.CreateWritableClone();
            page.Property["ImageVaultImage"].Value = "/ImageVaultFiles/id_1/cf_2/Chrysanthemum.JPG?~1~Foo";
            DataFactory.Instance.Save(page, SaveAction.Publish);
The only way to store a file in ImageVault is by using IVDataFactory.UploadFile. Can you be more specific of what you are trying to do and maybe I can help.
#46706
Dec 28, 2010 22:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.