473,382 Members | 1,362 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,382 software developers and data experts.

Upload error message display

Hi there,

Is there a handy way to show error message instead of error code when
uploading?

For example, if I get error code 3 (UPLOAD_ERR_PARTIAL), I can
directly show users that 'Only part of the file was uploaded.' instead
of if $errorCode==3 then print 'Only part of the file was uploaded.',
which is time-consuming.

Thanks,

Oct 3 '07 #1
2 1956
Hi,

You could make a function uploadErrorMsg($errCode) which will return
the message string so you can re-use it.

Ming wrote:
Hi there,

Is there a handy way to show error message instead of error code when
uploading?

For example, if I get error code 3 (UPLOAD_ERR_PARTIAL), I can
directly show users that 'Only part of the file was uploaded.' instead
of if $errorCode==3 then print 'Only part of the file was uploaded.',
which is time-consuming.

Thanks,
Oct 3 '07 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ming wrote:
Hi there,

Is there a handy way to show error message instead of error code when
uploading?

For example, if I get error code 3 (UPLOAD_ERR_PARTIAL), I can
directly show users that 'Only part of the file was uploaded.' instead
of if $errorCode==3 then print 'Only part of the file was uploaded.',
which is time-consuming.

Thanks,
What's wrong with $errorCode==3?

I would probable create an array of all error messages, where each
element index corresponds to an error number. Then you could simple say
something like;

echo $errorArray[3];
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHBNdJQuDJiZ/QrH0RAm4/AKCp4B9VokQ2RtzMaazNuihRwZoX6wCgm2Ig
n6LUlFaglf/D/g2bBNqc/jY=
=Q4ot
-----END PGP SIGNATURE-----
Oct 4 '07 #3

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

Similar topics

5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
4
by: Amar | last post by:
I am trying to upload a file to the webserver through my asp.net application. The file upload works fine for files below 50 MB size because i have set the maxrequestlength property of the...
3
by: | last post by:
Thanks Richard and Shan, I am using the HtmlInputFile control.But Shan where exactly do you want me to put in your code? becoz,after the user selects a file to upload and hits Submit, then the...
5
by: Matt Chubb | last post by:
I've searched the forums and the net and have not found a solution to this upload problem, any suggestions/help in this matter would be greatly appreciated. I'm trying to trap and display an...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
7
by: Defacta | last post by:
Hi, I have set my max upload file to 200M by modifiying the php.ini file: ; Maximum allowed size for uploaded files. upload_max_filesize = 200M The function: echo...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: simon2x1 | last post by:
i have an upload page called upload.php and a display upload called display.php while i make use of my wamp server on my localhost and i access upload.php to upload an image the image go to a folder...
4
by: MoroccoIT | last post by:
Greetings - I saw somewhat similar code (pls see link below) that does mupltiple files upload. It works fine, but I wanted to populate the database with the same files that are uploaded to...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.