Jump to content

Image Uploader the OOP way


closed_tag

Recommended Posts

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!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/129709-image-uploader-the-oop-way/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.