private void UploadImage(Product p) { if (ucImageUploadLarge.HasFile) { var fileName = Text.CleanFileName(Path.GetFileName(ucImageUploadLarge.FileName)); if ( !DiskStorage.CopyProductImage(HccApp.CurrentStore.Id, p.Bvin, ucImageUploadLarge.TempImagePath, fileName)) { ucMessageBox.ShowError("Only .PNG, .JPG, .GIF file types are allowed for icon images"); } } }
private void UploadImage(Product p) { if (ucImageUploadLarge.HasFile) { var fileName = Text.CleanFileName(Path.GetFileName(ucImageUploadLarge.FileName)); if ( !DiskStorage.CopyProductImage(HccApp.CurrentStore.Id, p.Bvin, ucImageUploadLarge.TempImagePath, fileName)) { ucMessageBox.ShowError(Localization.GetString("ImageFileTypeError")); } } }
private void ImportImageFile(string productId, string filename) { var importPath = ImagesImportPath; if (string.IsNullOrEmpty(importPath)) { importPath = DiskStorage.GetStoreDataVirtualPath(_hccApp.CurrentStore.Id, "import/"); } var filePath = importPath + filename; var mappedPath = HostingEnvironment.MapPath(filePath); if (File.Exists(mappedPath)) { DiskStorage.CopyProductImage(_hccApp.CurrentStore.Id, productId, filePath, filename); } }