closed_tag Posted October 23, 2008 Share Posted October 23, 2008 Greetings guys, I am familiar with the uploading scripts around the web but still, I am curious how the big guys such as FLICKR or any other that has uploading in it.... How they upload images with such big file size! I tried the . HTACCESS way but still no luck. and other server settings but still..... I just need the logic behind the script........ Thank you! Quote Link to comment Share on other sites More sharing options...
keeps21 Posted October 23, 2008 Share Posted October 23, 2008 I'd imagine you need to change the maximum upload size in the php.ini and it should be straight forward from there? Quote Link to comment Share on other sites More sharing options...
alexweber15 Posted October 23, 2008 Share Posted October 23, 2008 nothing OO-related here but it answers the file-size question: function return_kbytes($val) { $val = trim($val); if (strlen($val) == 0) { return 0; } $last = strtolower(substr($val,strlen($val/1),1)); switch ($last) { // The 'G' modifier is available since PHP 5.1.0 case 'g': $val *= 1024; case 'm': $val *= 1024; case 'k': $val *= 1; } return $val; } $m = is_renameable(); /* get maximum upload size */ function getMaximumUploadSize() { $upload_max = return_kbytes(ini_get('upload_max_filesize')); $post_max = return_kbytes(ini_get('post_max_size')); return $upload_max < $post_max ? $upload_max : $post_max; } Credit where its due: Both above functions are from the script: "TinyWebGallery" written by Michael Dempfle and licensed under the GPLv2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.