mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-10 09:52:15 +02:00
prevent overwriting if uploaded file already exists #138,
IE11 aborts upload after 30s #137
This commit is contained in:
parent
622264042a
commit
a8c2fc66d6
|
@ -3,13 +3,13 @@
|
||||||
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}';
|
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H3K | Tiny File Manager V2.3.2
|
* H3K | Tiny File Manager V2.3.3
|
||||||
* CCP Programmers | ccpprogrammers@gmail.com
|
* CCP Programmers | ccpprogrammers@gmail.com
|
||||||
* https://tinyfilemanager.github.io
|
* https://tinyfilemanager.github.io
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//TFM version
|
//TFM version
|
||||||
define('VERSION', '2.3.2');
|
define('VERSION', '2.3.3');
|
||||||
|
|
||||||
// Auth with login/password (set true/false to enable/disable it)
|
// Auth with login/password (set true/false to enable/disable it)
|
||||||
$use_auth = true;
|
$use_auth = true;
|
||||||
|
@ -641,6 +641,11 @@ if (!empty($_FILES) && !FM_READONLY) {
|
||||||
$fullPath = $path . '/' . $_REQUEST['fullpath'];
|
$fullPath = $path . '/' . $_REQUEST['fullpath'];
|
||||||
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
|
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
|
||||||
|
|
||||||
|
if(file_exists ($fullPath)) {
|
||||||
|
$ext_1 = $ext ? '.'.$ext : '';
|
||||||
|
$fullPath = str_replace($ext_1, '', $fullPath) .'_'. date('ymdHis'). $ext_1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_dir($folder)) {
|
if (!is_dir($folder)) {
|
||||||
$old = umask(0);
|
$old = umask(0);
|
||||||
mkdir($folder, 0777, true);
|
mkdir($folder, 0777, true);
|
||||||
|
@ -943,7 +948,7 @@ if (isset($_GET['upload']) && !FM_READONLY) {
|
||||||
this.on("sending", function (file, xhr, formData) {
|
this.on("sending", function (file, xhr, formData) {
|
||||||
let _path = (file.fullPath) ? file.fullPath : file.name;
|
let _path = (file.fullPath) ? file.fullPath : file.name;
|
||||||
document.getElementById("fullpath").value = _path;
|
document.getElementById("fullpath").value = _path;
|
||||||
xhr.ontimeout = (() => {
|
xhr.ontimeout = (function() {
|
||||||
alert('Error: Server Timeout');
|
alert('Error: Server Timeout');
|
||||||
});
|
});
|
||||||
}).on("success", function (res) {
|
}).on("success", function (res) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"appName": "Tiny File Manager",
|
"appName": "Tiny File Manager",
|
||||||
"version": "2.3.2",
|
"version": "2.3.3",
|
||||||
"language": [
|
"language": [
|
||||||
{
|
{
|
||||||
"name": "русский",
|
"name": "русский",
|
||||||
|
|
Loading…
Reference in a new issue