Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update
  • Loading branch information
peter-mw committed Jul 1, 2022
1 parent c2991b3 commit 9ebbb4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MicroweberPackages/App/functions/plupload.php
Expand Up @@ -336,9 +336,12 @@
// Make sure the fileName is unique but only if chunking is disabled
if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
$ext = strrpos($fileName, '.');

$fileName_a = substr($fileName, 0, $ext);
$fileName_b = substr($fileName, $ext);

$fileName_b = strtolower($fileName_b);

$count = 1;
while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b)) {
++$count;
Expand Down Expand Up @@ -500,7 +503,7 @@

if (is_file($filePath) and !$chunks || $chunk == $chunks - 1) {
$ext = get_file_extension($filePath);

$ext = strtolower($ext);
if (function_exists('finfo_open') and function_exists('finfo_file')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
$mime = @finfo_file($finfo, $filePath);
Expand Down

0 comments on commit 9ebbb4d

Please sign in to comment.