What is with this error message?????? First part validates, second part
fails...
getimagesize (filename...) failed to open stream: No such file or directory
} elseif ($photo) {
$ext = strtolower(substr($photo, -3));
if ($ext == "peg") { $ext = "jpg"; }
if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "bmp" )
{
$focus = "photo";
$msg2 = "Please provide a valid gif, jpeg, or bmp photo or do not
attach one.";
} else {
$size = getimagesize($photo);
if ($size > 25000) {
$msg2 = "Photo must be smaller than 25k.";
}}} 1 3664
Philip D Heady wrote: What is with this error message?????? First part validates, second part fails...
getimagesize (filename...) failed to open stream: No such file or directory
} elseif ($photo) {
$ext = strtolower(substr($photo, -3));
if ($ext == "peg") { $ext = "jpg"; }
if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "bmp" ) {
$focus = "photo"; $msg2 = "Please provide a valid gif, jpeg, or bmp photo or do not attach one.";
} else {
$size = getimagesize($photo);
if ($size > 25000) {
$msg2 = "Photo must be smaller than 25k.";
}}}
What is $photo? It should be a URL or a path to a file (either absolute or
relative). However, if you get it working, you'll run into a problem with the
next line. First, getimagesize() returns an array. Second, none of the
elements in the array relate to filesize. They relate to it's type, height and
width. http://ca.php.net/manual/en/function.getimagesize.php
You should read about filesize(): http://ca.php.net/manual/en/function.filesize.php
Or if this is a file the user has uploaded, try using:
$_FILES['photo']['size'] http://ca.php.net/features.file-upload
Shawn
--
Shawn Wilson sh***@glassgiant.com http://www.glassgiant.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: rcb845 |
last post by:
Hi everybody of the PHP community,
I am using the php function "getimagesize()" to access the
width/height of an image
from the Web. This function should return false if image is not
available.
Most of the time the function works correctly, but in 2 or 3 cases I
have
a problem like, search is going on for minutes, and the function does
|
by: Eclectic |
last post by:
I am using the latest version of PHP and GD (reinstalled both today -
march 29 2005) and am using GD to create thumbnails on the fly. I am
having no issues with GD, however, I am now trying to retrieve the
width and height of other images withought ANY sucess ... I am
recieving the same error repeatedly :
"... failed to open stream: No such...
|
by: Lucid77 |
last post by:
I keep getting an error on line 43 which Is the line in which
$image_size = getimagesize($fullsized); occurs, although I cannot seem
to find the problem. Any help is much appreciated.
Sam
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html...
|
by: sree |
last post by:
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;
$imageInfo = getimagesize($src);
|
by: lawrence k |
last post by:
I've got an intermittent bug that is very hard to trace. On my site, if
I log into a new account and try to upload some images, something goes
wrong the first time. Everything works fine after the first time, but
the first time getimagesize fails to return a type, which is blank in
the following error messge. I'm going to check for weird path...
| |
by: stephcsh |
last post by:
Hi,
My application is working fine on server A, which is using PHP 4.4.1. However, after it is copied over to server B, which is using PHP 4.4.6, I got several problems related to pdf and xml.
1) I got this message when i tried to generate a pdf, with image:
getimagesize(http://www.myweb.com/image/photo_2.jpg) : failed to open stream:...
|
by: bluesky9394 |
last post by:
I encounter the following error.
Warning: getimagesize(WebRoot/common/images/profile/) : failed to open stream: Permission denied in C:\Data\PHPSites\kamwo\indextmp-new.php on line 296
but it's working fine on my another php script.
php code:
$path = "WebRoot/common/images/profile/";
$file = $row1;
|
by: Ja NE |
last post by:
(as first - thank you for all your help several years ago, and second - please
apologise me for my clumsy enlgish)
so, preface: some users on my photo related site sometimes enter (link) giant
photo in their post or coment, and while I was writting new bbcode for my
forum, I have got idea to check size of linked pictures to scale them down...
|
by: RobUK |
last post by:
We have Apache on the local network managing several websites that are accessed using virtual domains (configured in the local machine's hosts file, eg. 192.168.1.10 points to dev.somedomain.com).
I am reworking the way that I access images on the site by specifying the http://etc address of the image instead of the local relative address. This...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |