/    Sign up×
Community /Pin to ProfileBookmark

image handling & thumnail

[B]i want 2 make thumnail and store in the folder[/B]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>
<?php

if(isset($_POST[‘save’]))

{

$file_dir = “C:/Program Files/EasyPHP1-8/www/matri/Matri_Dev1.01/photo/”;

if (($HTTP_POST_FILES[‘fileupload’][‘type’]==”image/gif”) || ($HTTP_POST_

FILES[‘fileupload’][‘type’]==”image/bmp”) || ($HTTP_POST_FILES[‘fileupload’][‘type’]==”image/pjpeg”) || ($HTTP_POST_FILES[‘fileupload’][‘type’]==”image/jpeg”)) {

}

// image check for existing

if (file_exists($file_dir . $HTTP_POST_FILES[‘fileupload’][‘name’])) { echo “The file already exists – plz change file name in Upload Image 1 & upload <br>n”; exit; }

}

//$cont=0;

foreach($_FILES as $file_name => $file_array) {

$path=$file_array[‘tmp_name’];
$name=$file_array[‘name’];
$type=$file_array[‘type’];
$size=$file_array[‘size’];

//$image[$cont]=$name;
//$cont++;

if (is_uploaded_file($file_array[‘tmp_name’])) {
move_uploaded_file($file_array[‘tmp_name’],
“$file_dir/$file_array[name]”) or die (“Couldn’t copy”);

}

$conn = mysql_connect(“localhost”,”root”,””) or die(mysql_error());
mysql_select_db(“mms”,$conn) or die(mysql_error());

$today = date (“Y-m-d”);
//echo”$today”;
$sql = “INSERT INTO image values (”,’$name’,’ ‘,”,’$_POST[id]’,’$today’)”;
$result = mysql_query($sql, $conn) or die(mysql_error());

print “File Uploaded successfully!<br><br>”;
}

$conn = mysql_connect(“localhost”,”root”,””) or die(mysql_error());
mysql_select_db(“mms”,$conn) or die(mysql_error());

$list = “select * from image where image.u_id=’3′”;
$list = mysql_query($list) or die(mysql_error());
$count=mysql_num_rows($list);
if ($count > 0) {

$query = “SELECT imageone,imagetwo,imagethree FROM image,user WHERE image.u_id=’3′”;

$result = mysql_query($query) or die(‘Error, query failed’);
//while(list($imageone, $imagetwo, $imagethree) = mysql_fetch_array($result))//{
list($imageone, $imagetwo, $imagethree) = mysql_fetch_array($result);

?>

<img src=”photo/<?php echo $imageone; ?>” width=”200″ height=”200″/></img>

<?php
}else {
echo “<img src=”photo/noimage.jpg” width=”100″ height=”100″/>”;
}
?>

<form action=”testimg.php” enctype=”multipart/form-data” method=”POST”>
<input type=”hidden” name=”MAX_FILE_SIZE” value=”131072″>
Upload Image 1: <input type=”file” name=”fileupload”><br><br>
<input type=’hidden’ name=’id’ value=”3″><br />
<input type=’submit’ name=”save” value=’Upload File’>
</form>

</body>

</html>

[B]When I upload image 1944 * 2500 it doe’s not store in photo folder. If i upload image 150*150 it works well. May any one help me specially to Ruben.

HELP NEEDED [/B]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@jchapaFeb 27.2006 — The problem is with your max file size value. Increase this value to handle larger files.

jchapa
Copy linkTweet thisAlerts:
@kumar005authorFeb 28.2006 — May i max file size to upload.
Copy linkTweet thisAlerts:
@bokehFeb 28.2006 — May i max file size to upload.[/QUOTE]Not from within your script. This value needs to be changed in php.ini or httpd.conf or .htaccess.
×

Success!

Help @kumar005 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...