首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何上传.gif文件到smartedit中?

如何上传.gif文件到smartedit中?
EN

Stack Overflow用户
提问于 2020-11-24 17:57:37
回答 2查看 327关注 0票数 1

为什么现在SmartEdit中不允许使用gif-s,尽管配置中有不同的说明:

代码语言:javascript
复制
public ACCEPTED_FILE_TYPES: string[] = [
    'jpeg',
    'jpg',
    'gif',
    'bmp',
    'tiff',
    'tif',
    'png',
    'svg'
];

smartedit会显示错误消息:“选定的文件类型无效”,但是我们可以通过后台轻松添加.gif文件。我们使用hybry19.05版本。

EN

回答 2

Stack Overflow用户

发布于 2020-11-26 18:00:41

这是1905年Hybris版本的一个已知错误。如果您将其升级到2005或2011版本,它将被修复,以下是针对该bug的jira的链接:

https://cxjira.sap.com/browse/ECP-4148

作为@gif has mentioned,如果您不想进行升级,您可以在angular配置文件类型上添加智能编辑接受的РоманЛотоцький的mime类型来修复它:

474946383961为业务团队上传图片的mime类型码

  1. 在中创建名为myBestextensionMimeType.js的文件

$HYBRIS/hybris/bin/custom/myBestextension/web/features/myBestextensionContainer directory.

  1. 在myBestextensionMimeType.js中创建Angular模块myBestextensionMimeTypeModule:

angular.module('myBestextensionMimeTypeModule',[])

  1. 将媒体类型添加到自定义扩展模块:

代码语言:javascript
复制
- Copy the existing mime type codes defined in cmssmartedit to your myBestextensionMimeTypeModule in myBestextensionMimeType.js. The list you define in myBestextensionMimeType.js overrides the existing list defined in seFileMimeTypeServiceConstants constant in cmssmartedit. You copy the list to retain the current values so that you can add to them.
代码语言:javascript
复制
- Append additional new mime types to the list of values in myBestextensionMimeType.js.

下面来自myBestextensionMimeType.js的代码示例显示了从cmssmartedit复制的mime类型代码以及您添加到列表中的新mime类型:

angular.module('myBestextensionMimeTypeModule',[]) .constant('seFileMimeTypeServiceConstants',{ VALID_IMAGE_MIME_TYPE_CODES:'FFD8FFDB','FFD8FFE0','FFD8FFE1','474946383761','424D','49492A00','4D4D002A','89504E470D0A1A0A',//在这里插入额外的mime类型代码'474946383961‘// GIF89a的mime类型代码示例};

  1. 打开扩展容器的根模块,并将新创建的mime类型模块添加到$HYBRIS/hybris/bin/custom/myBestextension/web/features/myBestextensionContainer/myBestextensioncontainerModule.ts,如下例所示:

@SeModule({ ...imports:'smarteditServicesModule','abAnalyticsToolbarItemModule',//在这里导入新模块'myBestextensionMimeTypeModule',})导出类MyBestextensionContainer {}

根容器是<custom-extension-name>containerModules.ts。在我们的示例中,根容器是myBestextensioncontainerModule.ts.

  1. 重建您的扩展:

cd $HYBRIS/hybris/bin/custom/myBestextension ant build

票数 1
EN

Stack Overflow用户

发布于 2020-11-25 18:44:27

我将这个数字474946383961添加到有效的图像mime类型中,这很有帮助。

公共VALID_IMAGE_MIME_TYPE_CODES: string[] = 'FFD8FFDB','FFD8FFE0','FFD8FFE1','474946383761','474946383961',// gif幻数'424D','49492A00','4D4D002A','89504E470D0A1A0A','3C3F786D6C207665','3C73766720786D6C‘;

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64984087

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档