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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.