2

I get the following error:

getimagesize(barbie2.jpeg) [function.getimagesize]: failed to open stream: No such file or directory

On line:

list($hight, $width) = getimagesize($name);
hakre
  • 184,866
  • 48
  • 414
  • 792
Karthika
  • 37
  • 2
  • 2
  • 3
  • is this an uploaded file? is the file "barbie2.jpeg" is in the same directly as your php file? – Sufendy Oct 25 '11 at 05:25
  • Related: [Reference - What does this error mean in PHP?](http://stackoverflow.com/q/12769982/367456) – hakre Dec 24 '12 at 11:28

2 Answers2

8

in getimagesize() you need to specify path of the image. Probably it is not getting image path so it is giving you error.

your file from where you have called this function and image location is different so it is giving you error.

BenMorel
  • 31,815
  • 47
  • 169
  • 296
Rukmi Patel
  • 2,591
  • 8
  • 27
  • 41
4

You can specify the path of the image by using $_FILES["fileToUpload"]["tmp_name"] because when you upload the file is stored in the temp directory.

Anthony
  • 131
  • 1
  • 1