简体   繁体   English

Orbeon-如何验证用户上传的文件内容

[英]Orbeon - how to validate file content uploaded by user

I need to validate content of pdf file sent by "File Attachement" component, using Webservice, uploaded by user. 我需要使用用户上传的Web服务来验证“文件附件”组件发送的pdf文件的内容。

How to do that ? 怎么做 ?

Action Value Change is not called 不调用操作值更改

ver.orbeon-4.4.0.201311042036-PE Thanks Piotr ver.orbeon-4.4.0.201311042036-PE感谢Piotr

That probably requires a few steps: 这可能需要一些步骤:

  1. Determine when the upload is complete. 确定何时完成上传。 With recent versions of Orbeon Forms, the event xxforms-upload-done can be used. 在最新版本的Orbeon Forms中,可以使用事件xxforms-upload-done

  2. Send the content of the uploaded file to a service. 将上传文件的内容发送到服务。 The file can be a binary file, but there is a way to submit binary content . 该文件可以是二进制文件,但是有一种提交二进制内容的方法

  3. Depending on what the service returns, mark the control valid or invalid. 根据服务返回的内容,将控件标记为有效或无效。 You could do this with an attribute on the element holding the uploaded file's URL, eg: <my-upload valid="true"/> and then use a constraint like constraint="@valid = 'true'" . 您可以使用保存上载文件URL的元素上的属性来执行此操作,例如: <my-upload valid="true"/> ,然后使用诸如constraint="@valid = 'true'"类的constraint="@valid = 'true'"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM