Current location: Hot Scripts Forums » Programming Languages » PHP » multiple image upload and resize - pls help

multiple image upload and resize - pls help

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-21-05, 02:28 AM
ashishsehgal ashishsehgal is offline
New Member
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
multiple image upload and resize - pls help

I am using the following code for uploading multiple files ( images ) on the server. I need to resize each of them during the upload process. Can anyone help me with the present script pls.
Thanks a lot.
--------------
Form Input Code:

<form action="picpost.php" method="post" enctype="multipart/form-data" name="stage4" id="stage4">
<table width="700" border="1" align="center" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF">
<tr bordercolor="#C0C0C0" bgcolor="#EEEEEE">
<td valign="top"><div align="center">
<p>
<?php
$numoffile = 1+$_POST['expics'];
for($i=0;$i<$numoffile;$i++) {
print "<input type='file' name='myfiles[]' size='30'><br>";
}
?>
</p>

<input type="submit" name="Submit" value="Upload" />
</form>
---------------------------

uploading script ( this is where i need help to resize the picturs to 300 pixels height )

<?php
$listfolderid=$row_rsmem['mem_id'].time();
$numoffile = 1 + $_POST['expics'];
$mypath="/serversomepath/"."/".$listfolderid."/";
mkdir($mypath, 0777);
$file_dir = $mypath;
if ($_POST) {
for ($i=0;$i<$numoffile;$i++) {
if (trim($_FILES['myfiles']['name'][$i])!="") {
$newfile = $file_dir.$_FILES['myfiles']['name'][$i];
move_uploaded_file($_FILES['myfiles']['tmp_name'][$i],$newfile);
$j++;
}
}
}
if (isset($j)&&$j>0) print "<br><b>Your file(s) has been uploaded.</b><br>";

?>
-----------------------

I also have imagemagick on server but dont know how to use it ( in the above script )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
image resize and upload ascanio PHP 0 06-25-05 07:37 PM
upload and watermark StickMan PHP 6 07-28-04 09:33 PM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 09:30 PM
Help with image resize mdhall PHP 3 02-25-04 02:53 AM
Upload rename, resize & database insert therat PHP 3 01-16-04 03:42 PM


All times are GMT -5. The time now is 03:38 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.