[Rt-commit] rt branch, 4.4/check-uploaded-file-size, updated. rt-4.4.2-100-g2a27489a0

Maureen Mirville maureen at bestpractical.com
Fri Dec 14 10:48:52 EST 2018


The branch, 4.4/check-uploaded-file-size has been updated
       via  2a27489a0f84b935e7df30b9d5afb7753de44e27 (commit)
      from  3a5e2ad365f45dd267059f8b83b35fe7a0ecaedf (commit)

Summary of changes:
 etc/RT_Config.pm.in                       | 6 +++---
 share/html/Ticket/Elements/AddAttachments | 8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 2a27489a0f84b935e7df30b9d5afb7753de44e27
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Fri Dec 14 10:43:56 2018 -0500

    Update dropzone max file size error
    
    Updated dropzone attachment file size rounding and unit from MiB
    to MB for better readability. Styling of error also updated to make
    it more clear the file exceeds the maximum allowed file size.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 4ef8f0979..ee1b0fd51 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -393,7 +393,7 @@ read.
 
 =cut
 
-Set($MaxAttachmentSize, 10*1024*1024);  # 10MiB
+Set($MaxAttachmentSize, 10*1000*1000);  # 10MB
 
 =item C<$TruncateLongAttachments>
 
@@ -3033,7 +3033,7 @@ Certain object types, like values for Binary (aka file upload) custom
 fields, are always put into external storage. However, for other
 object types, like images and text, there is a line in the sand where
 you want small objects in the database but large objects in external
-storage. By default, objects larger than 10 MiB will be put into external
+storage. By default, objects larger than 10 MB will be put into external
 storage. C<$ExternalStorageCutoffSize> adjusts that line in the sand.
 
 Note that changing this setting does not affect existing attachments, only
@@ -3041,7 +3041,7 @@ the new ones that C<sbin/rt-externalize-attachments> hasn't seen yet.
 
 =cut
 
-Set($ExternalStorageCutoffSize, 10*1024*1024);
+Set($ExternalStorageCutoffSize, 10*1000*1000);
 
 =item C<$ExternalStorageDirectLink>
 
diff --git a/share/html/Ticket/Elements/AddAttachments b/share/html/Ticket/Elements/AddAttachments
index 1f968aabf..b5f229a14 100644
--- a/share/html/Ticket/Elements/AddAttachments
+++ b/share/html/Ticket/Elements/AddAttachments
@@ -63,7 +63,8 @@
         <div class="dropzone" id="attach-dropzone">
         </div>
 <script type="text/javascript">
-var MaxAttachmentSizeMiB = RT.Config.MaxAttachmentSize/(1024*1024);
+var rawAttachmentSize = RT.Config.MaxAttachmentSize/(1000*1000);
+var MaxAttachmentSizeMB = rawAttachmentSize.toFixed(3);
 
 Dropzone.autoDiscover = false;
 jQuery( function() {
@@ -71,7 +72,8 @@ jQuery( function() {
         url: RT.Config.WebHomePath + '/Helpers/Upload/Add?Token=' + jQuery('#attach-dropzone').closest('form').find('input[name=Token]').val(),
         paramName: "Attach",
         dictDefaultMessage: <% loc("Drop files here or click to attach") |n,j %>,
-        maxFilesize: MaxAttachmentSizeMiB,
+        maxFilesize: MaxAttachmentSizeMB,
+        dictFileTooBig: "File is too big ({{filesize}} MB). Max filesize: {{maxFilesize}} MB.",
         parallelUploads: 1,
         previewTemplate: '' +
             '<div class="dz-preview dz-file-preview">' +
@@ -113,7 +115,7 @@ jQuery( function() {
             '            <title>' + loc_key('error') + '</title>' +
             '            <defs></defs>' +
             '            <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">' +
-            '                <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">' +
+            '                <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FF0000" fill-opacity="0.816519475">' +
             '                    <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458' +
             '                    L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436' +
             '                    C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578' +

-----------------------------------------------------------------------


More information about the rt-commit mailing list