[opencms-dev] file management
脸谱
afeinet at 163.com
Wed Jul 10 08:37:55 CEST 2019
Hi.
I'm sorry, the following text, I am translated by Bing Translator, I hope you can understand.
Yesterday and today I spent several hours retesting this feature and found no problems.
Code is submitted today:
https://github.com/Yuanuo/opencms-core/commit/a1883c4c86ca1f200876f0f2e5dea345d815bc69
Or checkout this Branch: https://github.com/Yuanuo/opencms-core/tree/patch-07
The test method I use:
1, using the version provided in http://www.opencms.org/en/modules/downloads/dl-opencms-11.0-beta-distribution.html.
And the installation was successful.
Then stop the Web service.
(Because I don't use Git very much, it's a hassle for me to keep a lot of local and official changes, so my code base hasn't been synchronized with the official code base for a long time.So use this version for testing!)
2, using the code of https://github.com/Yuanuo/opencms-core/tree/patch-07, directly gradle bindist compiles a version.
3, replace the files in webapps\ROOT\WEB-INF\lib\ with the files in BuildCms\libs\ which you have compiled yourself.
4, modify the webapps\ROOT\config\opencms-vfs.xml, adding the following configuration (in the /opencms/vfs xml-path),something like:
<opencms>
<vfs>
......
......
</xmlcontent>
<filecontent>
<!-- If you have these file suffixes, drivers stored to disk are used. -->
<handle>
<driver class="org.opencms.file.content.refs.CmsFileContentDriver">
<param name="refs.marker">REFS::</param>
<param name="refs.storage">../REFS-DISK1</param>
</driver>
<extension value=".mp3"/>
<extension value=".mp4"/>
<extension value=".rar"/>
<extension value=".zip"/>
<extension value=".exe"/>
<extension value=".pdf"/>
</handle>
<!-- Or file size great than ~10MB, drivers stored to disk are used. -->
<handle>
<driver class="org.opencms.file.content.refs.CmsFileContentDriver">
<param name="refs.marker">REFS::</param>
<param name="refs.storage">../REFS-DISK2</param>
</driver>
<minlength value="10000000"/>
</handle>
<!-- Otherwise, using the default implementation, the content is stored in the database. -->
<handle>
<driver class="org.opencms.file.content.CmsFileContentDriver" />
</handle>
</filecontent>
</vfs>
</opencms>
5, start the Web service.
At this point, you can try to upload a few large files in the Opencms Explorer management interface to try out the effect.
Need to explain:
Through the above tests, there is no problem.
But, One thing you need to note is that the length property in CmsResource uses the int type, so it means that the uploaded files cannot exceed 2G!
I tried to modify this int to long before, but there was a lot of code to modify, so I gave it up.
I can't say how good this is, but it does meet that requirement. If you think it's useful, you can optimize it better.
I hope it will help.
--
缘起法实不可思议也。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20190710/b0b65ffa/attachment.htm>
More information about the opencms-dev
mailing list