Negative filesize on ARMv7 for files over 2GB #127

Simplified Chinese translation #125
Max file size? #96
This commit is contained in:
Prasath Mani 2019-02-28 15:35:28 +05:30
parent e0cc54b286
commit da31717cff
3 changed files with 55 additions and 38 deletions

View file

@ -66,7 +66,7 @@ To enable/disable authentication set `$use_auth` to true or false.
- :zap: Backup files
- :mag_right: Search - Search and Sorting using `datatable js`
- :file_folder: Exclude folders from listing
- :globe_with_meridians: Multi-language support (English, Spanish, French, Italian, German, Russian, Thailand and Chinese ) for translations `translation.json` is file required
- :globe_with_meridians: Multi-language support (English, Spanish, French, Italian, German, Russian, Thailand, Chinese and more..) for translations `translation.json` is file required
- :bangbang: lots more...

View file

@ -3,13 +3,13 @@
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}';
/**
* H3K | Tiny File Manager V2.3.1
* H3K | Tiny File Manager V2.3.2
* CCP Programmers | ccpprogrammers@gmail.com
* https://tinyfilemanager.github.io
*/
//TFM version
define('VERSION', '2.3.1');
define('VERSION', '2.3.2');
// Auth with login/password (set true/false to enable/disable it)
$use_auth = true;
@ -935,6 +935,7 @@ if (isset($_GET['upload']) && !FM_READONLY) {
<script>
Dropzone.options.fileUploader = {
timeout: 120000,
maxFilesize: 2048, //2GB
init: function () {
this.on("sending", function (file, xhr, formData) {
let _path = (file.fullPath) ? file.fullPath : file.name;
@ -1204,7 +1205,7 @@ if (isset($_GET['view'])) {
$ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
$mime_type = fm_get_mime_type($file_path);
$filesize = filesize($file_path);
$filesize = fm_get_filesize(filesize($file_path));
$is_zip = false;
$is_gzip = false;
@ -1635,7 +1636,7 @@ $all_files_size = 0;
$is_link = is_link($path . '/' . $f);
$img = $is_link ? 'fa fa-file-text-o' : fm_get_file_icon_class($path . '/' . $f);
$modif = date(FM_DATETIME_FORMAT, filemtime($path . '/' . $f));
$filesize_raw = filesize($path . '/' . $f);
$filesize_raw = fm_get_size($path . '/' . $f);
$filesize = fm_get_filesize($filesize_raw);
$filelink = '?p=' . urlencode(FM_PATH) . '&amp;view=' . urlencode($f);
$all_files_size += $filesize_raw;
@ -1993,6 +1994,22 @@ function fm_get_translations($tr) {
}
}
/**
* @param $file
* Recover all file sizes larger than > 4GB.
* Works on php 32bits and 64bits and supports linux
* @return int|string
*/
function fm_get_size($file)
{
$return = filesize($file);
if(substr(PHP_OS, 0, 3) == "WIN") {
exec('for %I in ("'.$file.'") do @echo %~zI', $output);
$return = $output[0];
}
return $return;
}
/**
* Get nice filesize
* @param int $size

View file

@ -1,6 +1,6 @@
{
"appName": "Tiny File Manager",
"version": "2.3.1",
"version": "2.3.2",
"language": [
{
"name": "русский",
@ -351,74 +351,74 @@
}
},
{
"name": "中文(简体)",
"code": "simpch",
"name": "简体中文",
"code": "zh-CN",
"translation": {
"AppName": "文件管理器",
"AppTitle": "文件管理器",
"AppName": "Tiny File Manager",
"AppTitle": "文件及目录管理器",
"Login": "登录",
"Username": "账号",
"Password": "密码",
"Logout": "注销",
"Logout": "退出",
"Move": "移动",
"Copy": "复制",
"Copy": "拷贝",
"Save": "保存",
"SelectAll": "全选",
"UnSelectAll": "取消全选",
"File": "文件",
"Back": "返回",
"Size": "大小",
"Back": "取消上传",
"Size": "文档大小",
"Perms": "权限",
"Modified": "修改时间",
"Owner": "所有人",
"Search": "搜索",
"NewItem": "新文件",
"Owner": "拥有者",
"Search": "查找",
"NewItem": "创建新文件/文件夹",
"Folder": "文件夹",
"Delete": "删除",
"CopyTo": "复制到",
"DirectLink": "直链",
"UploadingFiles": "上传文件",
"UploadingFiles": "上传",
"ChangePermissions": "修改权限",
"Copying": "复制",
"Copying": "复制",
"CreateNewItem": "创建新文件",
"Name": "文件名",
"AdvancedEditor": "高级编辑",
"RememberMe": "记住",
"Actions": "作",
"AdvancedEditor": "高级编辑",
"RememberMe": "记住登录信息",
"Actions": "可执行操作",
"Upload": "上传",
"Cancel": "取消",
"InvertSelection": "反选",
"InvertSelection": "反",
"DestinationFolder": "目标文件夹",
"ItemType": "文件类型",
"ItemName": "文件名称",
"ItemName": "创建名称",
"CreateNow": "创建",
"Download": "下",
"UnZip": "解压",
"UnZipToFolder": "解压至文件夹",
"Download": "下",
"UnZip": "解压",
"UnZipToFolder": "解压至目标文件夹",
"Edit": "编辑",
"NormalEditor": "普通编辑",
"NormalEditor": "编辑",
"BackUp": "备份",
"SourceFolder": "源文件夹",
"Files": "文件",
"Change": "修改",
"Settings": "置",
"Settings": "置",
"Language": "语言",
"Open": "开",
"Group": "组",
"Other": "其",
"Read": "读取",
"Write": "写入",
"Execute": "执行",
"Open": "",
"Group": "用户组",
"Other": "其它用户",
"Read": "读取权限",
"Write": "写入权限",
"Execute": "执行权限",
"Rename": "重命名",
"enable": "启",
"disable": "关闭",
"enable": "",
"disable": "禁用",
"ErrorReporting": "上传错误报告",
"ShowHiddenFiles": "显示隐藏文件"
}
},
{
"name": "中文(繁體)",
"code": "tradch",
"code": "zh-TW",
"translation": {
"AppName": "檔案管理器",
"AppTitle": "檔案管理器",