-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
geradeaus wrote:
Even if you upload an image partially with ftp software, you can
still read the image. Only the image will be partially gray.
So, can I determine with a php-function if an image is fully
uploaded on the server and without checking the filesize using an
interval in time?
To be completely clear : this isn't about http-upload, but about
uploaded files with external ftp-software.
Thanks in advance!
Hi,
I'm not sure, but see if the Image functions that load image files
(imagecreatefromjpeg, imagecreatefromgif, imagecreatefrompng, and so
on) will return error codes on truncated image files. If they do,
just figure out what format the image was supposed to be in, try to
load it, and see if it works.
If not, I suspect you'd have to investigate image-format-specific
routines (i.e. roll-your-own JPEG checker, roll-your-own GIF checker,
and so on, which might not be too hard if you only use one or two
formats, but which would require you to understand the image formats
yourself).
Alternatively, if you're the only one uploading files, maybe you could
set something up so that partial files don't stay lying around
(either the server or the client sets some option to delete them if
they're incomplete).
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBbfjDgxSrXuMbw1YRAqEkAKCnONehj2RdP0dpFUZvGj LoC4KeRgCeN47d
giwP+0CLIcLa/YKpx0nhQ30=
=PSpP
-----END PGP SIGNATURE-----