<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-signature"><font color="#666666" size="-1">The
following seems to work for us in one of our FTP import routines we
check the file size with a sleep in the middle<br>
<br>
<br>
                                    $this-&gt;write_debug(date('d/m/Y
H:i:s') . " - Import file found, checking for completed upload - " .
$upload_file);<br>
<br>
                                    $first_file_size =
filesize($upload_file);<br>
                                    $this-&gt;write_debug("Initial
filesize - " . $first_file_size);<br>
<br>
                                    sleep(UPLOAD_DETECTION_TIME);<br>
                                    clearstatcache();<br>
<br>
                                    $compare_file_size =
filesize($upload_file);<br>
                                    $this-&gt;write_debug(date('d/m/Y
H:i:s') . " - compare filesize - " . $compare_file_size);<br>
<br>
                                    # Only continue if the filesizes
have not changed<br>
                                    if ($first_file_size ==
$compare_file_size) {<br>
                                        # Should be safe to import, we
need to work out what type of file this is<br>
                                        $this-&gt;write_debug("Filesize
unchanged the file will be processed");<br>
<br>
<br>
</font>
</div>
<br>
<br>
Alex Mace wrote:
<blockquote
 cite="mid:C6BC21CB-0448-4669-9AB5-C46717834917@hollytree.co.uk"
 type="cite">I haven't personally tried using feof in that situation,
so I couldn't tell you for sure, but I don't think that it would work.
  <br>
  <br>
Perhaps checking the modification time to see if it's changed in the
last (say) 5 minutes and ignoring it if it has until that time has
passed would be a better solution? Or use an FTP server that you can
script to move completed uploads to another location?
  <br>
  <br>
Alex
  <br>
  <br>
On 2 Jul 2008, at 15:40, alan dunn wrote:
  <br>
  <br>
  <blockquote type="cite">We have zip files being uploaded to an FTP
folder from various laptops. We then plan to open those files using a
cron job. My concern is that we shouldn't try to open and process a
file before upload is complete.
    <br>
    <br>
Is it OK to just use  feof = true going to do this or do we need to be
more thorough?
    <br>
    <br>
Are there methods of monitoring a file to see when upload is complete
and then switching on the next stage of the process?
    <br>
    <br>
thanks, alan dunn
    <br>
-- <br>
    <br>
DISCLAIMER:
    <br>
    <br>
This document originates from within Dunns Imaging Group Limited.
    <br>
This message, together with any associated files, is intended only for
the use of the individual or entity to which it is addressed and may
contain information that is confidential, subject to copyright or
constitutes a trade secret. If you are not the intended recipient of
this communication you are hereby notified that any dissemination,
copying or distribution of this message, or of any files associated
with this message, is strictly prohibited.
    <br>
If you have received this message in error, please notify us at once.
    <br>
    <br>
Dunns Imaging Group Ltd.
    <br>
Registered Office: Chester Road Cradley Heath West Midlands B64 6AA.
    <br>
Tel: 01384 564770
    <br>
Registered in England 598527.
    <br>
    <br>
    <br>
_______________________________________________
    <br>
Phpwm mailing list
    <br>
<a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
    <br>
<a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
    <br>
  </blockquote>
  <br>
  <br>
_______________________________________________
  <br>
Phpwm mailing list
  <br>
<a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
  <br>
<a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
  <br>
  <br>
</blockquote>
</body>
</html>