[BUGFIX] Avoid error message on unlimited upload_max_filesize 61/47061/2
authorAndreas Bouche <andreas.bouche@flagbit.de>
Thu, 3 Mar 2016 21:33:36 +0000 (22:33 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 4 Mar 2016 15:09:22 +0000 (16:09 +0100)
Resolves: #73214
Releases: master, 7.6
Change-Id: I9496964ffd9daeb2c330f022c876f6aceacced1c
Reviewed-on: https://review.typo3.org/47061
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index d63c285..6f48c47 100644 (file)
@@ -542,7 +542,7 @@ define(['jquery',
                me.$iconCol.html('<span class="t3-icon t3-icon-mimetypes t3-icon-other-other">&nbsp;</span>')
 
                // check file size
-               if (me.file.size > me.dragUploader.maxFileSize) {
+               if (me.dragUploader.maxFileSize > 0 && me.file.size > me.dragUploader.maxFileSize) {
                        me.updateMessage(TYPO3.lang['file_upload.maxFileSizeExceeded']
                                .replace(/\{0\}/g, me.file.name)
                                .replace(/\{1\}/g, DragUploader.fileSizeAsString(me.dragUploader.maxFileSize)));
index 4557473..12ea38a 100644 (file)
@@ -932,7 +932,7 @@ class ResourceStorage implements ResourceStorageInterface
         }
         // Max upload size (kb) for files.
         $maxUploadFileSize = GeneralUtility::getMaxUploadFileSize() * 1024;
-        if ($uploadedFileSize >= $maxUploadFileSize) {
+        if ($maxUploadFileSize > 0 && $uploadedFileSize >= $maxUploadFileSize) {
             unlink($localFilePath);
             throw new Exception\UploadSizeException('The uploaded file exceeds the size-limit of ' . $maxUploadFileSize . ' bytes', 1322110041);
         }