开发者

What is the alternative to getimagesize () which is disabled on a shared server

开发者 https://www.devze.com 2023-03-04 03:39 出处:网络
When I use getimagesize() in my hosting company which is a shared server, I get the following error.

When I use getimagesize() in my hosting company which is a shared server, I get the following error.

Message: getimagesize() [function.getimagesize]: 开发者_开发问答URL file-access is disabled in the server configuration

Filename: admin/admin_product_home.php

What is the alternative to get the image size of images?

Thanks in advance.

echo "<tr>\n";
    echo "<td>".$list."</td>\n";
            $filepath = base_url()."uploads/".$list;
            echo "<td><img width=\"70px\" src='".$filepath."' /></td>";
            echo "<td>";
            $filesize = getimagesize($filepath);
    echo "width: ".$filesize[0]. "px<br />";
    echo "height: ".$filesize[1]. "px<br />";
            echo "</td>";
    echo "<td>";
        ...
        ...

I am using codeigniter as you can see in base_url().


The problem isn't with getimagesize but with the file name you are trying to open.

It looks like you're using a http:// URL in the getimagesize() call, despite the file name you quote saying otherwise.

Make sure you are using a local file path.

Edit: Create a file path variable without base_url() and prepend the correct filesystem path.

0

精彩评论

暂无评论...
验证码 换一张
取 消