469,323 Members | 1,247 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

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 1849
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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.