Hello Kuntesh,
The Kentico Import Toolkit is able to import custom fields, however it is not capable of importing the MetaFile object type that the SKU uses, so that needs to be done via API. Here is a short example showing how to import an image from file, and assign it to a SKU.SKUImagePath property:
private void addProductWithImage(SKUInfo sku, string imagePath)
{
if (sku == null || String.IsNullOrEmpty(imagePath))
{
return;
}
if (File.Exists(imagePath))
{
// Get file contents from file system
byte[] imageBinaryData = File.ReadAllBytes(imagePath);
if (imageBinaryData != null)
{
MetaFileInfo file = new MetaFileInfo();
file.MetaFileObjectID = sku.SKUID;
file.MetaFileBinary = imageBinaryData;
file.MetaFileObjectType = "ecommerce.sku";
file.MetaFileGroupName = "Image";
file.MetaFileName = "SampleImage.gif";
file.MetaFileExtension = ".gif";
file.MetaFileSize = imageBinaryData.Length;
file.MetaFileMimeType = "image/gif";
file.MetaFileImageWidth = 100;
file.MetaFileImageHeight = 100;
file.MetaFileSiteID = CurrentSite.SiteID;
file.Insert();
sku.SKUImagePath = MetaFileInfoProvider.GetMetaFileUrl(file.MetaFileGUID, file.MetaFileName);
sku.Update();
}
}
}