natefromdetroit Posted February 22, 2009 Share Posted February 22, 2009 Hi everyone. I'm having troubles adding an image size function on this code. What the goal is: for the image uploaded to be saved just how it is, unaffected, and a copy be made at 800 pixels max wide and saved in a different folder. Here is the code. Thank you in advance to anyone that may be able to help, I appreciate it. <body STYLE="background-color:transparent"> <?php include("header.html"); @$Name = addslashes($_POST['Name']); @$email = addslashes($_POST['email']); @$upload_Name = $_FILES['upload']['name']; @$upload_Size = $_FILES['upload']['size']; @$upload_Temp = $_FILES['upload']['tmp_name']; @$upload_Mime_Type = $_FILES['upload']['type']; function RecursiveMkdir($path) { if (!file_exists($path)) { RecursiveMkdir(dirname($path)); mkdir($path, 0777); } } if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email)) { die("<p align='center'><b><font face='Arial Black' size='5' color='#FF0000'>Please enter a valid email</font></b></p>"); } if( $upload_Size == 0) { die("<p align='center'><b><font face='Arial Black' size='2' color='#FF0000'>ERROR<br>YOUR FILE WAS NOT UPLOADED<br>PLEASE CHECK THE FILE SIZE AND FORMAT</font></b></p>"); } if( $upload_Size >13000000) { unlink($upload_Temp); die("<p align='center'><b><font face='Arial Black' size='2' color='#FF0000'>ERROR<br>YOUR FILE WAS NOT UPLOADED<br>PLEASE CHECK THE FILE SIZE AND FORMAT</font></b></p>"); } if( $upload_Mime_Type != "image/cgm" AND $upload_Mime_Type != "image/g3fax" AND $upload_Mime_Type != "image/gif" AND $upload_Mime_Type != "image/ief" AND $upload_Mime_Type != "image/pjpeg" AND $upload_Mime_Type != "image/jpeg" AND $upload_Mime_Type != "image/naplps" AND $upload_Mime_Type != "image/png" AND $upload_Mime_Type != "image/prs.btif" AND $upload_Mime_Type != "image/prs.pti" AND $upload_Mime_Type != "image/tiff" AND $upload_Mime_Type != "image/vnd.cns.inf2" AND $upload_Mime_Type != "image/vnd.dwg" AND $upload_Mime_Type != "image/vnd.dxf" AND $upload_Mime_Type != "image/vnd.fastbidsheet" AND $upload_Mime_Type != "image/vnd.fpx" AND $upload_Mime_Type != "image/vnd.fst" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-mmr" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-rlc" AND $upload_Mime_Type != "image/vnd.mix" AND $upload_Mime_Type != "image/vnd.net-fpx" AND $upload_Mime_Type != "image/vnd.svf" AND $upload_Mime_Type != "image/vnd.wap.wbmp" AND $upload_Mime_Type != "image/vnd.xiff" ) { unlink($upload_Temp); die("<p align='center'><b><font face='Arial Black' size='2' color='#FF0000'>ERROR<br>YOUR FILE WAS NOT UPLOADED<br>PLEASE CHECK THE FILE SIZE AND FORMAT</font></b></p>"); } @$upload_Name = str_replace( ' ', '', @$upload_Name ); @$upload_Name = str_replace( '/', '_', @$upload_Name ); $uploadFile = "images/galleries/".$upload_Name ; if (!is_dir(dirname($uploadFile))) { @RecursiveMkdir(dirname($uploadFile)); } else { @chmod(dirname($uploadFile), 0777); } @move_uploaded_file( $upload_Temp , $uploadFile); chmod($uploadFile, 0644); $upload_URL = "http://records.alwaysgoodmusic.com/uploades2/images/galleries/".$upload_Name ; $pfw_header = "From: $email"; $pfw_subject = "AN IMAGE HAS BEEN UPLOADED"; $pfw_email_to = "[email protected]"; $pfw_message = "email: $email\n" . "Name: $Name\n" . "upload: $upload_URL\n"; @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ; echo("<p align='left'><font color='#FFD69C' size='5' face='Arial, Helvetica, sans-serif'><dl><dd>Picture Uploaded!</dd> </p><p align='center'><img src=$upload_URL width='400'/></p><p align='center'><font color='#2D2D2D' size='2' face='Arial, Helvetica, sans-serif'>Thanks, $Name, for uploading $upload_Name<br><br>Your picture can now be seen in the gallery among the other beautiful pictures people have shared.</p></font>"); ?> http://records.alwaysgoodmusic.com/uploads2/email-image-upload.html Link to comment https://forums.phpfreaks.com/topic/146331-image-resize-help-please/ Share on other sites More sharing options...
natefromdetroit Posted February 23, 2009 Author Share Posted February 23, 2009 Anyone? ??? Link to comment https://forums.phpfreaks.com/topic/146331-image-resize-help-please/#findComment-769605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.