468,296 Members | 1,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

check if image is partially uploaded with ftp-software

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!
Jul 17 '05 #1
1 2296
-----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-----
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark | last post: by
4 posts views Thread by Gianpiero Colagiacomo | last post: by
2 posts views Thread by SoSaucily | last post: by
11 posts views Thread by bissatch | last post: by
11 posts views Thread by Chris Croughton | last post: by
2 posts views Thread by Geoff | last post: by
2 posts views Thread by swethak | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.