[wp-trac] [WordPress Trac] #27229: Display image file size in media uploader when uploaded
WordPress Trac
noreply at wordpress.org
Sat Mar 1 16:46:32 UTC 2014
#27229: Display image file size in media uploader when uploaded
----------------------------------------+---------------------------------
Reporter: noumaan | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug | Focuses: ui, administration
----------------------------------------+---------------------------------
Comment (by QasAshraf):
Hi, I'm a newcomer looking to contribute. I've been having a look at what
changes would need to be made to implement this new feature.
Looks like there's already a fileLength attribute defined in the view
template which is only rendered if the JSON response contains this
attribute. Not sure if it's used for anything else, but could possibly be
used for the file size attribute?
//*[@id="tmpl-attachment-details"]
I can't see how to add an extra instance variable to the Attachment model,
but I think you'd have to add an extra instance variable which returned
the file size for each image. If it's not already implicitly known, I'm
guessing if we already have the filename then we could use the
`filesize($filename)` function to get the size of the file.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27229#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list