Upload error message display
am 03.10.2007 22:19:03 von Ming
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,
Re: Upload error message display
am 04.10.2007 01:40:28 von petersprc
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,
Re: Upload error message display
am 04.10.2007 14:06:33 von James Barrett
-----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/AKCp4B9VokQ2RtzMaazNuihRwZoX6wCg m2Ig
n6LUlFaglf/D/g2bBNqc/jY=
=Q4ot
-----END PGP SIGNATURE-----