check if image is partially uploaded with ftp-software

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • geradeaus

    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!


  • Chris

    #2
    Re: check if image is partially uploaded with ftp-software

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    geradeaus wrote:
    [color=blue]
    > 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![/color]

    Hi,
    I'm not sure, but see if the Image functions that load image files
    (imagecreatefro mjpeg, imagecreatefrom gif, imagecreatefrom png, 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)

    iD8DBQFBbfjDgxS rXuMbw1YRAqEkAK CnONehj2RdP0dpF UZvGjLoC4KeRgCe N47d
    giwP+0CLIcLa/YKpx0nhQ30=
    =PSpP
    -----END PGP SIGNATURE-----

    Comment

    Working...