有没有办法使用 AGX 标记值来限制文件字段上的文件类型?
使用 argo uml 和 archgenxml,我有一个文件字段。我想将其限制为一个扩展名:.ttf
我可以使用标记值来执行此操作吗? 还有 AGXProfile 的术语表可以回答这个问题吗?
Using argo uml and archgenxml, I have a file field. I would like to restrict it to one extension: .ttf
Can I do this using a tagged value?
Also is there a glossary for the AGXProfile which would answer this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试
FileField|ImageField
的allowable_content_types
mime 类型属性,但我找不到任何表明该属性已完成验证的信息。 IOW,如果用户上传其他内容,这不会向用户显示错误。如果您想要这样,您必须自己编写一个 AT 字段验证器来获取文件并根据mimetype_registry
对其进行验证。You could try the
allowable_content_types
mime type property ofFileField|ImageField
s but I can't find anything that indicates that validation is done on that property. IOW, this wouldn't show the user an error if they uploaded something else. If you want that, you're going to have to write an AT field validator yourself that takes the file and validates it against themimetype_registry
.