Supporting integrity check
DEXTUploadX5 provides the hash generation function to support the integrity check of uploaded files.
If the integrity check is set, hash values are generated every time for files, and they are transmitted to the server together when files are uploaded. The server component generates hash values based on the information of the uploaded file, checks whether these hash values matches the hash values sent from the client, and determines the identity of the original file. If the values are different, the server component will treat it as an error.
Here are some things to note:
The integrity check feature only supports DEXTUploadX5 3.4.0.0 or later.
Integrity check function can be used only in conjunction with our server component product (DEXTUploadNJ 2.6.0 or higher).
Integrity check function works only in large file upload mode ('EXTS').
Upload time increases because there is a process of generating hash values.
- How to set up DEXTUploadX5 integrity check
-
The following is an example of setting DEXTUploadX5.
function onDX5Created(id) { var dx = dx5.get(id); ... // Set the upload mode to 'EXTS'. dx.setUploadMode("EXTS"); // Set to support integrity check. dx.setChecksumEnable(true); } - Server-side setup using the DEXTUploadNJ server component
-
Because the large file upload mode is used, you can set the 'checksumEnable' parameter value of ExtensionFileUploadFilter to 'true'. There is no code to be added by the developer other than the DD (web.xml) setting.
<filter> <filter-name>extensionFileUploadFilter</filter-name> <filter-class>devpia.dextuploadnj.support.common.ExtensionFileUploadFilter</filter-class> ... <!-- If the 'checksumEnable' parameter value is set to 'true', integrity check is performed. --> <init-param> <param-name>checksumEnable</param-name> <param-value>true</param-value> </init-param> ... </filter> <filter-mapping> <filter-name>extensionFileUploadFilter</filter-name> ... </filter-mapping> - Server-side setup using the DEXTUploadNJ server component (Spring Framework)
-
After DEXTUploadNJ 2.6.0, DEXTUploadNJSpringExtensionUploadFilter can be used instead of ExtensionFileUploadFilter, and the setting method to support the integrity function is the same.
<filter> <filter-name>extensionFileUploadFilter</filter-name> <filter-class>devpia.dextuploadnj.support.spring.DEXTUploadNJSpringExtensionUploadFilter</filter-class> ... <init-param> <param-name>checksumEnable</param-name> <param-value>true</param-value> </init-param> ... </filter> <filter-mapping> <filter-name>extensionFileUploadFilter</filter-name> ... </filter-mapping>Configuration using DEXTUploadNJSpringExtensionUploadFilter is valid only in Spring environment. If the filter is set using DEXTUploadNJSpringExtensionUploadFilter in the JSP/Servlet environment, an error may occur.