Jump to content

Image Uploading..code didnt work..


jronyagz

Recommended Posts

Insert Quote
hello guys,i just whant to know why this code did not save the image on the new DIR $upload_paths,it will only successfully create the folder but the image will not be saved. i hope smbody could enlighten me..thnx!

if(is_dir($upload_path)) {             
    $upload_paths =mkdir($upload_path."24x24".'/', 0700);
if(is_dir(mkdir($upload_paths)) {
      if ($_POST['type'] == 'image/pjpeg' || $_POST['type'] == 'image/gif' || $_POST['type'] ==
                    'image/x-png' || $_POST['type'] == 'image/bmp' || $_POST['type'] == 'image/jpeg') {
            if ($_POST['type'] == 'image/pjpeg' || $_POST['type'] == 'image/jpeg') {
              $img=imagecreatefromjpeg($upload_paths.$_POST['name']);
            }
            elseif ($_POST['type'] == 'image/gif') {
              $img=imagecreatefromgif($upload_paths.$_POST['name']);
            }
            elseif ($_POST['type'] == 'image/x-png') {
              $img=imagecreatefrompng($upload_paths.$_POST['name']);
            }
            elseif ($_POST['type'] == 'image/bmp') {
              $img=imagecreatefromwbmp($upload_paths.$_POST['name']);
            }
$AttachmentThumbnail->thumbnail($img,205,272,$upload_paths,$_POST['name'],205,272); 
      }
          }
      } 
Link to comment
https://forums.phpfreaks.com/topic/28261-image-uploadingcode-didnt-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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