Jump to content


Photo

ok so tell me this....


  • Please log in to reply
7 replies to this topic

#1 ForumGuy

ForumGuy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 18 August 2006 - 02:52 PM

if all my parameters for a files upload are correct why doesn't it work?

i have all the settings on ridiculous so the file can't be too big or be taking too long....but it still doesn't work?

smaller files still work, i just don't grasp the madness of it all.....

can someone please help me, PLEASE.

i've searched everywhere and can't find anything new on the subject of making the file size acceptable larger, i've done everything i've been directed to do.

??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
is it me or is it it....?

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 18 August 2006 - 02:54 PM

Alright, we're going to need a little more information.

1) Can you modify the php.ini file?
2) What is the size of the file you're trying to upload?
3) What steps have you taken?
4) Can you show us your code for the form and the processing of the upload?
5) If the smaller files still work, are you printing out any debug code for the bigger files?

Info: PHP Manual


#3 ForumGuy

ForumGuy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 18 August 2006 - 03:12 PM

well basically....

max_execution_time = 10000

max_input_time = 10000

memory_limit = 10000M

post_max_size = 8000M

upload_max_filesize = 1000M


the file i try to upload is 2,298k

and it just seems to give no error and is empty...its like the file is too large for post_max_size

any ideas?

i will post my form if necesary?
is it me or is it it....?

#4 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 August 2006 - 03:50 PM

Yes code would be helpful. And did you make sure your file permissions were correct??
Ray

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 18 August 2006 - 04:38 PM

Also when you changed the settings in the php.ini you did restart your server. If you dont restart your server the new PHP settings will not be loaded. Also I think 8000MB is a bit ott! But yeah please post the code so we can see

#6 ForumGuy

ForumGuy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 22 August 2006 - 11:08 AM

ok this is the code, hope it helps  ;)

<?php

if(isset($_POST['Submit2']))

{
	$size = 75; // the thumbnail height
	$sizel = 300; // the image height
	$filedir = 'uploaded_images/'; // the directory for the original image
	$thumbdir = 'uploaded_images/thumbs/'; // the directory for the thumbnail image
	$prefix = 'thumb_'; // the prefix to be added to the original name

	$mode = '0666';
	
	$userfile_name = $_FILES['image']['name'];
	$userfile_tmp = $_FILES['image']['tmp_name'];
	$userfile_size = $_FILES['image']['size'];
	$userfile_type = $_FILES['image']['type'];
	
	if (isset($_FILES['image']['name'])) 
	{
		$prod_img = $filedir.$userfile_name;

		$prod_img_thumb = $thumbdir.$prefix.$userfile_name;
		move_uploaded_file($userfile_tmp, $prod_img);
		chmod ($prod_img, octdec($mode));
		
		$sizes = getimagesize($prod_img);
		
		$aspect_ratio = $sizes[1]/$sizes[0]; 
		
		//Image resizing		
		if ($sizes[1] <= $size)
		{
			$height = $size;
			$width = abs($height/$aspect_ratio);
		}else{
			$width = $sizes[0];
			$height = $sizes[1];
		}
		$destimg=ImageCreateTrueColor($width,$height) or die('Problem In Creating image');
		$srcimg=ImageCreateFromJPEG($prod_img) or die('Problem In opening Source Image');
		ImageCopyResampled($destimg, $srcimg, 0, 0, 0, 0, $width, $height, $sizes[0], $sizes[1]) or die('Problem In resampling');
		ImageJPEG($destimg,$prod_img,75) or die('Problem In saving');
		
		//Thumnail resizing
		if ($sizes[1] <= $size)
		{
			$new_width = $sizes[0];
			$new_height = $sizes[1];
		}else{
			$new_height = $size;
			$new_width = abs($new_height/$aspect_ratio);
		}
		$destimg=ImageCreateTrueColor($new_width,$new_height) or die('Problem In Creating image');
		$srcimg=ImageCreateFromJPEG($prod_img) or die('Problem In opening Source Image');
		ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die('Problem In resizing');
		ImageJPEG($destimg,$prod_img_thumb,50) or die('Problem In saving');
		imagedestroy($destimg);
	}
	$img_ad_id = $_POST['AdID'];
	echo "
	<table width='100%' border='0' cellspacing='1' cellpadding='6'>
    <tr>
    <td bgcolor='#FFFFFF'>
	<a href='".$prod_img."' target='_BLANK'>
	<img src='".$prod_img_thumb."' width='".$new_width."' height='".$new_height."'>
	</a><br />
	click submit to proceed!
	<form name='form1' method='POST' action='".$editFormAction."'>
	<input type='hidden' name='AdPicThumb1' value='".$prod_img_thumb."' />
	<input type='hidden' name='AdPic1' value='".$prod_img."' />
	<input type='hidden' name='AdID' value='".$img_ad_id."' />
	<input type='hidden' name='MM_update' value='form1'>
	<input type='Submit' name='Submit' value='Submit'>
	</form>
	</td>
    </tr>
  	</table>
	";

}else{
    
	echo "
	<table width='100%' border='0' cellspacing='1' cellpadding='6'>
    <tr>
    <td bgcolor='#FFFFFF'>
	<form name='form' method='POST' action='".$_SERVER['PHP_SELF']."' enctype='multipart/form-data'>
	<input type='file' name='image' size='65'><br />
	<input type='hidden' name='AdID' value='".$_GET['AdID']."' />
	<input type='Submit' name='Submit2' value='Submit'><br />
	</form>
	</td>
    </tr>
  	</table>
	";
}
?>

is it me or is it it....?

#7 ForumGuy

ForumGuy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 24 August 2006 - 01:21 PM

i posted the code like asked....plz help... ???

is there anything else that could restrict the size of the file that i'm uploading?

:-\ :'(
is it me or is it it....?

#8 ForumGuy

ForumGuy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 31 August 2006 - 11:22 AM

hey wildteen88,Craygo theres the code you wanted, can you help or not???
is it me or is it it....?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users