<html><head></head><body>Hello,<br><br>I have the same need ( storing very big files outside the database)<br><br>Your idea seems good and I am very interested in your code!<br><br>If you are agree to share your code, here is my @mail : vswm@free.fr<br><br>Thanks in advance.<br><br>Franck. <br><br><div class="gmail_quote">Le 8 juillet 2019 07:35:48 GMT+02:00, "脸谱" <afeinet@163.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><br><div>Finally see others have this need, share my experience here.</div><div><br></div><div>Last year, I also had the idea of storing some large files directly on disks outside the database.And then I did it myself.</div><div><br></div><div>The implementation principle is like this, for example, to store a 1G MP4 file,</div><div>Store the data directly on disk when uploading files;</div><div>Store the file path stored on disk as the contents of the VFS file for OpenCMS;(At the front of this stored path I used a few special letters "REFS::" do the mark)</div><div>When the end user accesses this file, the contents of the VSF file are first read from inside the database, and then the first few bytes are taken to determine if it is "REFS::", at this point the file data on the disk is read directly to return to the client. </div><div><br></div><div>At the time, I fully implemented these features, and it was configured to decide what files could be stored on disk rather than in the database.</div><div>I've added this configuration to opencms-vfs.xml (by the file name suffix):</div><div><br></div><div><filecontent></div><div><span style="white-space:pre">    </span><handle></div><div>        <!-- If you have these file suffixes, drivers stored to disk are used. --></div><div><span style="white-space:pre">             </span><driver class="org.opencms.file.content.refs.CmsFileContentDriver"></div><div><span style="white-space:pre">                   </span><param name="refs.marker">REFS::</param></div><div><span style="white-space:pre">                        </span><param name="refs.storage">../REFS-DISK1</param></div><div><span style="white-space:pre">                </span></driver></div><div><span style="white-space:pre">               </span><extension value=".mp3"/></div><div><span style="white-space:pre">             </span><extension value=".mp4"/></div><div><span style="white-space:pre">             </span><extension value=".rar"/></div><div><span style="white-space:pre">             </span><extension value=".zip"/></div><div><span style="white-space:pre">             </span><extension value=".exe"/></div><div><span style="white-space:pre">             </span><extension value=".pdf"/></div><div><span style="white-space:pre">     </span></handle></div><div><span style="white-space:pre">       </span><handle></div><div>        <!-- Otherwise, using the default implementation, the content is stored in the database. --></div><div><span style="white-space:pre">           </span><driver class="org.opencms.file.content.CmsFileContentDriver" /></div><div><span style="white-space:pre">      </span></handle></div><div></filecontent></div><div><br></div><div><br></div><div>And to implement such a function, modify a large number of code, also passed the test, the actual operation did not have a problem.</div><div><br></div><div>Of course, this approach may be completely different from what officials mentioned before, although they have now given up on implementing this feature. If someone is interested in this, I can share the code that implements this feature.</div><br><br><br><div style="position:relative;zoom:1">--<br><div><br></div>
<div>缘起法实不可思议也。</div></div></div><br><br><span title="neteasefooter"><p> </p></span></blockquote></div></body></html>