473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

uploading multiple image files

hi all,

A user can upload maximum 10 image files at once.
When the user only uploads 6 images, 4 fileboxes are left blank. I use
function checkImage() //check the the extension. Must be a jpeg
{
$bool = 0;

$this->type = $_FILES['imagefile']['type'][$this->index];
if ($this->type == "image/pjpeg" || $this->type == "image/jpg")
{
$bool = 1;
}
else
{
$bool = 0;
$this->errorMessage .= "- Not an image ($this->type). Image has to be a
jpeg<br>";
}
return $bool;
}

to test the image.
I go from 0 -> 10. When it comes along a blank imagebox the function doesn't
return anything. Someone knwos why. Is there a better way to check for a
blank filebox that is send?

kind regards
Stijn
Jul 17 '05 #1
1 1910
Stijn Goris wrote:

hi all,

A user can upload maximum 10 image files at once.
When the user only uploads 6 images, 4 fileboxes are left blank. I use
function checkImage() //check the the extension. Must be a jpeg
{
$bool = 0;

$this->type = $_FILES['imagefile']['type'][$this->index];
if ($this->type == "image/pjpeg" || $this->type == "image/jpg")
{
$bool = 1;
}
else
{
$bool = 0;
$this->errorMessage .= "- Not an image ($this->type). Image has to be a
jpeg<br>";
}
return $bool;
}

to test the image.
I go from 0 -> 10. When it comes along a blank imagebox the function doesn't
return anything. Someone knwos why. Is there a better way to check for a
blank filebox that is send?


Check the comment from "zilinex at linuxmail dot org" at:

http://ca3.php.net/features.file-upload

(I haven't tried it)

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
7
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No...
5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
6
by: B | last post by:
Hi, I'm developing a web application where users can upload multiple files to the website. I'm using asp.net 2.0 with FileUpload control and can upload 1 image to the server, but I would like...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
1
by: wenqiang7 | last post by:
I am encountering a very strang problem with file uploading in my ASP.Net page. When we try to upload certain file, we'll get an error msg of "Cannot find server or DNS Error". We are running...
1
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even...
1
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.