Posted by sree on 11/09/46 11:53
Hi,
am new bie to this group. I requesting help from you all.
Am geeting warnig with getimagesize() function. I will explain my
query by first giving my code.
$src = $_GET['src'];
$imageInfo = getimagesize($src);
echo $imageInfo[0]." ".$imageInfo[1];
It's working perfectly as i want when, the image is in the absolute
path. For example i am running this file under the /dev folder in root
directory. In dev i have one more folder called images which contain
some jpeg and gif files. Also one more folder called imgs in the root.
For easy understanding i picturized my directory stucture here.
Root
|
----- images --- This contains jpeg and gif files
|
----- dev
|
----- images --- This also contains jpeg and gif files
|
----- imagesize.php --- this is the file contains our
code
if i run this file by giving
www.domainname.com/dev/imagesize.php?src=images/1.jpg
It outputs the correct width and height of the image, but for this
www.domainname.com/dev/imagesize.php?src=/images/1.jpg
or this
www.domainname.com/dev/imagesize.php?src=../images/1.jpg
It wont result any thing, however it thows warning message like this
Warning: getimagesize(/images/1.jpg) [function.getimagesize]: failed to
open stream: No such file or directory in
/home/htdocs/dev/imagesize.php on line 4.
So, this is not working for relative paths.
I have tried it in the different server which is also have same
directory structure. In that it's working for both absolute and
relative paths.
I thing i need to change my server's configuration. but i dont know
which parameter needs to be changed.
anyone please help in this regard...
Thanks in advance
[Back to original message]
|