|
|
<ul style="font-family: " ingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: medium; padding-inline-start: 0px;"><li style="list-style-type: none; margin: 15px;"><span class="pre-scrollable"></span><div id="cnblogs_post_body" class="blogpost-body blogpost-body-html" style="margin-bottom: 20px; word-break: break-word;"><p style="margin: 10px auto;"><img src="https://img2020.cnblogs.com/blog/867078/202111/867078-20211116170525515-893988750.png" alt="" loading="lazy" style="max-width: 100%; height: auto;" /></p><h2 style="font-size: 21px; line-height: 1.5; margin: 10px 0px;">介绍</h2><p style="margin: 10px auto;">TinyFileManager是一个单文件的目录程序,优点是部署简单,快速,只需将文件上传至网站即可使用,并且功能丰富,几乎需要使用的功能都包含在内,支持数十种语言,包含中文繁/简字体;</p><p style="margin: 10px auto;"><img src="https://img2020.cnblogs.com/blog/867078/202111/867078-20211116170636945-706992096.gif" alt="" loading="lazy" style="max-width: 100%; height: auto;" /></p><h2 style="font-size: 21px; line-height: 1.5; margin: 10px 0px;">功能</h2><ul style="margin-left: 30px; padding-left: 0px;"><li style="list-style-type: disc;">支持上传下载</li><li style="list-style-type: disc;">支持URL上传</li><li style="list-style-type: disc;">支持多用户,账号/密码</li><li style="list-style-type: disc;">支持用户权限设置</li><li style="list-style-type: disc;">支持多国语言</li><li style="list-style-type: disc;">支持在线预览</li><li style="list-style-type: disc;">支持在线压缩/解压,使用zip</li><li style="list-style-type: disc;">支持在线创建/编辑/粘贴/复制/移动/删除</li><li style="list-style-type: disc;">支持在线搜索/筛选</li><li style="list-style-type: disc;">支持隐藏指定文件及文件夹</li></ul><div data-unique="源码"> </div><h2 style="font-size: 21px; line-height: 1.5; margin: 10px 0px;">源码</h2><p style="margin: 10px auto;">官网:<a href="https://tinyfilemanager.github.io/" target="_blank" style="text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: rgb(51, 122, 183);">https://tinyfilemanager.github.io</a><br />说明:<a href="https://tinyfilemanager.github.io/docs" target="_blank" style="text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: rgb(51, 122, 183);">https://tinyfilemanager.github.io/docs</a><br />演示:<a href="https://tinyfilemanager.github.io/demo" target="_blank" style="text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: rgb(51, 122, 183);">https://tinyfilemanager.github.io/demo</a><br />GitHub:<a href="https://github.com/prasathmani/tinyfilemanager" target="_blank" style="text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: rgb(51, 122, 183);">https://github.com/prasathmani/tinyfilemanager</a><br />密码生成:<a href="http://www.passwordtool.hu/php5-password-hash-generator" target="_blank" style="text-decoration-line: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; color: rgb(51, 122, 183);">http://www.passwordtool& ... word-hash-generator</a></p><div data-unique="使用"> </div><h2 style="font-size: 21px; line-height: 1.5; margin: 10px 0px;">使用</h2><p style="margin: 10px auto;">下载得到的压缩包解压后将其中的<code style="font-family: inherit;">tinyfilemanager.php</code>文件上传至网站目录并重命名为<code style="font-family: inherit;">index.php</code>即可<br />然后打开网站即可看到登录页面,默认有两个用户<code style="font-family: inherit;">用户名:admin密码:admin@123</code>和<code style="font-family: inherit;">用户名:user密码:12345</code></p><div data-unique="账户密码"> </div><h3 style="font-size: 16px; line-height: 1.5; margin: 10px 0px;">账户密码</h3><p style="margin: 10px auto;">修改用户及密码只需修改<code style="font-family: inherit;">index.php</code>中以下代码<br />前面的是用户名,密码部分采用的是PHP哈希密码值,从上面给出的密码生成网站生成即可;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: "Courier New" !important; font-size: 12px !important;"><pre style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: "Courier New", serif; overflow-wrap: break-word;"><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">//</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);"> Users: array('Username' => 'Password', 'Username2' => 'Password2', ...)</span>
<span style="font-size: inherit; line-height: 1.5; color: rgb(128, 0, 128);">$auth_users</span> = <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 0, 255);">array</span><span style="font-size: inherit; line-height: 1.5;">(
</span>'admin' => '$2y$10$axZWlisI..n9xmULN4gbhectUdOpu0z64xb9ysycHQ5ubKYcEY5sW', <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">//</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">admin</span>
'user' => '$2y$10$.mwmDmZH2003EjFobn86QuU3kr6NAmUYAaMVWQdLXYkirie7EJxj6', <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">//</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">12345</span>
);</pre></div><p style="margin: 10px auto;">如果不想使用账户密码,可以修改以下代码</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: "Courier New" !important; font-size: 12px !important;"><pre style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: "Courier New", serif; overflow-wrap: break-word;"><span style="font-size: inherit; line-height: 1.5; color: rgb(128, 0, 128);">$use_auth</span> = <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 0, 255);">true</span>;</pre></div><pre style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin: 10px auto;"><code class="hljs shell" style="font-family: inherit; transition-duration: 0.2s; transition-property: color, opacity, padding-top, padding-bottom, margin-top, margin-bottom, height; background: rgb(243, 243, 243); color: rgb(68, 68, 68); padding: 1em; display: block; overflow-x: auto;"><span class="hljs-meta" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(31, 113, 153);"><span class="bash" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><span class="hljs-literal" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(102, 153, 85);"><span class="hljs-meta" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(31, 113, 153);">
#<span class="bash" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"> 要使用账号密码设置为<span class="hljs-literal" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(102, 153, 85);">true,不使用账号密码设置为<span class="hljs-literal" style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;">false</span></span></span></span></span></span></span></code></pre><h3 style="font-size: 16px; line-height: 1.5; margin: 10px 0px;">设置语言</h3><p style="margin: 10px auto;"><code style="font-family: inherit;">index.php</code>这个程序文件是默认英语,不能设置成其它语言<br />修改语言需要将压缩包内的语言文件<code style="font-family: inherit;">translation.json</code>一同上传即可<br />然后即可在目录设置中修改语言了</p><div data-unique="隐藏文件"> </div><h3 style="font-size: 16px; line-height: 1.5; margin: 10px 0px;">隐藏文件</h3><p style="margin: 10px auto;">如果需要隐藏指定文件或文件夹,可以修改以下代码</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: "Courier New" !important; font-size: 12px !important;"><pre style="transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: "Courier New", serif; overflow-wrap: break-word;"><span style="font-size: inherit; line-height: 1.5; color: rgb(128, 0, 128);">$exclude_items</span> = <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 0, 255);">array</span><span style="font-size: inherit; line-height: 1.5;">();
</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">#</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);"> 例:隐藏名为sunpma的文件夹,隐藏名为sunpma.mp4的视频文件,隐藏所有后缀为.zip的文件;</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);">
#</span><span style="font-size: inherit; line-height: 1.5; color: rgb(0, 128, 0);"> 注意最后一个设置项没有,符号;</span>
<span style="font-size: inherit; line-height: 1.5; color: rgb(128, 0, 128);">$exclude_items</span> = <span style="font-size: inherit; line-height: 1.5; color: rgb(0, 0, 255);">array</span><span style="font-size: inherit; line-height: 1.5;">(
</span>'sunpma',
'sunpma.mp4',
'*.zip'<span style="font-size: inherit; line-height: 1.5;">
);</span></pre></div><p style="margin: 10px auto;">还有其它许多功能,大家可以看看官方说明文档,都解释得比较详细了;</p><p style="margin: 10px auto;"><span style="color: rgb(255, 0, 0);"><strong> 右上角设置没有反应,不能设置中文,或者无法编辑保存文件:</strong></span></p><p style="margin: 10px auto;">原因:google 的 js 库国内无法访问,可在 TinyFileManager.php 中,搜索ajax.googleapis.com替换:</p><p style="margin: 10px auto;">1. jquery.slim.min.js 的 js 链接为 “https://cdn.bootcdn& ... ;#46;min.js”<br />2. jquery.min.js 的 js 链接为 “https://cdn.bootcdn& ... ;#46;min.js”</p><p style="margin: 10px auto;">或自行加入如下文件:</p><p style="margin: 10px auto;">jquery.slim.min.js:</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: "Courier New" !important; font-size: 12px !important;"><img src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" id="code_img_closed_57743517-803b-49df-8552-b8afcd7a6a14" class="code_img_closed" style="max-width: 100%; height: auto; vertical-align: middle; padding-right: 5px;" /> <span class="cnblogs_code_collapse" style="border-width: 1px; border-style: solid; border-color: rgb(128, 128, 128); background-color: rgb(255, 255, 255); padding: 2px; font-family: "Courier New", serif; font-size: inherit; line-height: 1.5;">View Code</span></div><p style="margin: 10px auto;">jquery.min.js:</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: "Courier New" !important; font-size: 12px !important;"><img src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" id="code_img_closed_e8486197-3a30-4029-9ecd-a3a1cb48a581" class="code_img_closed" style="max-width: 100%; height: auto; vertical-align: middle; padding-right: 5px;" /> <span class="cnblogs_code_collapse" style="border-width: 1px; border-style: solid; border-color: rgb(128, 128, 128); background-color: rgb(255, 255, 255); padding: 2px; font-family: "Courier New", serif; font-size: inherit; line-height: 1.5;">View Code</span></div></div></li><li style="list-style-type: none; margin: 15px;"><div><span class="cnblogs_code_collapse" style="border-width: 1px; border-style: solid; border-color: rgb(128, 128, 128); background-color: rgb(255, 255, 255); padding: 2px; font-family: "Courier New", serif; font-size: inherit; line-height: 1.5;"><br /></span></div></li></ul><div><br /></div> |
|