11:57:45 PM
Wednesday
Sep 08
Su M Tu W Th F Sa
567891011
12131415161718
19202122232425
262728293012
3456789

Play My Typing Game

View Some of My Artwork

phpinfo and detecting upload max filesize
One of the easiest scripts to write is:

<? phpinfo(); ?>


which displays a long colorful page all about your server configurations. Look here to see what extensions are enabled, or would need to be recompiled with them enabled - if you wanted to use an extension. There are 2 pieces of info I often go looking for, to see how large of file upload can be allowed. PHP has a "glitch" in that if your filesize exceeds the server's limitation the value of $_FILES['userfile']['size'] is again 0. And to top it off, the user most likely waited a minute for this to occur. So I think its a good idea to tell the user about the restriction with a simple:
echo "(Limit: ".fetch_upload_limit()." )";


<?
function fetch_upload_limit()
{
 if(ini_get('post_max_size') < ini_get('upload_max_filesize'))
 {
     return ini_get('post_max_size');
 }
 else
 {
     return ini_get('upload_max_filesize');
 }
} // Usage: echo fetch_upload_limit();  Displays: 2M
?>


Read Previous:
Custom Regular Expression alphanumeric, underlines, hyphens & spaces allowed
Read Next:
Detecting Google Page Rank
Table of Contents


Give a listen to my music...
My Best Recordings
How my services and skills can help you:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local
    • Most all the above, but also:
      • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
      • Recording Live Music Audio
      • Video Streaming live music and other live events anywhere that can provide wifi
      • Training Video Streaming to your venue's trusted soundperson
Skills:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local, Most all the above, but also:
    • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
    • Being your venue's soundman
    • Video Streaming live music and other live events anywhere that can provide wifi
    • Training Video Streaming to your venue's trusted soundperson