Attachments File Size [Fixed] - Posted (2072 Views)
Forum Administrator
/Mvc/ProtectedContent/Avatar/philsbbs.jpg
Posts: 2269
starstarstarstarstar
Chrome 71 64bit
Windows 10 Pro latest build

Summary
I don't get the file size showing on attachments.
Steps to reproduce error
See post on my forum

http://midland.philsbbs.com/Topic/Posts/8957?pagenum=1&archived=0
Results
Expected result
---------------

Attached to show file size next to file name

Actual result
---------------

see : http://midland.philsbbs.com/Topic/Posts/8957?pagenum=1&archived=0


Notes/Attachments
http://midland.philsbbs.com/Topic/Posts/8957?pagenum=1&archived=0

Example
Phil
 Sort direction, for dates DESC means newest first    Page size 
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/philsbbs.jpg
Posts: 2269
starstarstarstarstar
Thank you @huwr change applied. thumbsUp
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4375
starstarstarstarstar
The fix is just a change to a template so you may attempt the fix yourself if you wish.
Open Views\Shared\PostMessage.cshtml and look for the code below (should be arounf line 370)
Code:
                        if (arr[1].indexOf("pdf") >= 0) {
$("#" + textId).insertAtCaret("[pdf]" + arr[0].replace('"', '') + "[/pdf]");
} else if (arr[1].indexOf("image") >= 0) {
$("#" + textId).insertAtCaret("[img]" + arr[0].replace('"', '') + "[/img]");
} else {

$("#" + textId).insertAtCaret("[file]" + arr[0].replace('"', '') + "[/file]");
}

Change it as below (or replace block with code below)
Code:
                        var filesize = "";
if (arr[1].indexOf("pdf") >= 0) {
$("#" + textId).insertAtCaret("[pdf]" + arr[0].replace('"', '') + "[/pdf]");
} else if (arr[1].indexOf("image") >= 0) {
$("#" + textId).insertAtCaret("[img]" + arr[0].replace('"', '') + "[/img]");
} else {
if (arr.length === 3) {
filesize = arr[2].replace('"', '');
}
$("#" + textId).insertAtCaret("[file " + filesize + "]" + arr[0].replace('"', '') + "[/file]");
}
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4375
starstarstarstarstar
Fixed here
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/Torborg.gif
Posts: 1711
starstarstarstar
A lot of rain here in the weekend too and some of the snow melted. Sunny and cold today. smile
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4375
starstarstarstarstar
Raining in Tampa this morning, but still mid twenties.
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/philsbbs.jpg
Posts: 2269
starstarstarstarstar
rain here in croydon, UK
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4375
starstarstarstarstar
Not sure I can cope with the weather back home, 26 and sunny here bigsmile
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/philsbbs.jpg
Posts: 2269
starstarstarstarstar
no rush you can stay out there a few more weeks (not months lol)
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4375
starstarstarstarstar
Well spotted, will fix on my return from sunny Miami smile
Posted
Forum Administrator
/Mvc/ProtectedContent/Avatar/philsbbs.jpg
Posts: 2269
starstarstarstarstar
Believe found the issue



If I use the attach file as marked in the image it does not upload the file size.

But if I use the paperclip to attach a file to a post it shows the size.
You Must enter a message