471,887 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 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 1913
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Amar | last post: by
3 posts views Thread by | last post: by
5 posts views Thread by Matt Chubb | last post: by
9 posts views Thread by Wayne Smith | last post: by
7 posts views Thread by Defacta | last post: by
5 posts views Thread by camphor | last post: by
reply views Thread by simon2x1 | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

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.