By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,716 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,716 IT Pros & Developers. It's quick & easy.

check if image is partially uploaded with ftp-software

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
-----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.