I'm writing a file upload class and I'm trying to be as intelligent about it as possible. (i.e. good, clean code).
My class has presently has a var called $_max_filesize var and if the user's file is larger than this, I say 'sod off.'
I am assuming this is on a webserver where I do not have root access. If I'm reading the php manual correctly, I need direct access to the php.ini file to use ini_set('max_upload_filesize',*)
With that assumption then I have decided to make sure the user, when he instantiates the class, cannot enter a larger value then what is specified in the php.ini file (using ini_get).
The question is, what values are allowed in the php.ini file for the 'max_upload_size' value? I've seen M for megabyte, but what is used for kilobyte, byte, etc...I want this so I can appropriately parse this info in my class to make sure when I finally end up comparing integers (of the user specified $_max_filesize and the .ini value 'max_upload_size') they are of the same relative size (i.e. both bytes)
I'm attempting to code for portability here and assume that it won't always be 2M or some other *M value. I appreciate any and all help. I've looked quite extensively on this forum and only found a few deadends.
If someone knows or can point me to the direction of all the allowed quantifiers ('M', etc) it would be very much appreciated...