Jump to content

[SOLVED] GETIMAGE Size on upload?


Gayner

Recommended Posts

im trying to use getimagesize function at the same type, uploading picture..

 

so whenever i use ($_FILES["file"]["name"]) I can get the dimensions for the pic they uploaded.

 

Warning: getimagesize(shop.gif) [function.getimagesize]: failed to open stream: No such file or directory in /home/gtcom/public_html/forums/ava/upload.php on line 42
Stored in: packs/cimage/shop.gif

 

 

 

42:

  list($width, $height, $type, $attr) = getimagesize($_FILES["file"]["name"]);

~~ -.-

Link to comment
https://forums.phpfreaks.com/topic/175584-solved-getimage-size-on-upload/
Share on other sites

$_FILES["file"]["name"] gets you the name of the file as it was on the client, uploads are stored at $_FILES['userfile']['tmp_name'] (this is the temp path and temp filename) before you move them so check there.

 

Oh.. i found it

Just had to move the stuff after,

 

move_uploaded_file($_FILES["file"]["tmp_name"],
      "packs/cimage/" . $_FILES["file"]["name"]);
  

 

so it reads it,

 

thx

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.