Really I am just thinking out loud here as the subject just came up in an
early morning meeting, so bear with me (I look forward to your opinions /
ideas on this) ...

Does the autoglobal $_FILES contain a ['time'] or ['timestamp']? If not I
could use a filemtime() to test each file.

Anyhow, we have some files on an Intranet for which I have created a file
management utility that will upload the file, return lists of files as
links, delete files, etc. "Can we upload files that replace existing files?"
was the question asked this morning. I off handedly said that this would not
be a problem, as long as the updated file was the same name as the existing
file.

I want to compare file datetimes so that I can make sure a newer file
replaces an older one. move_uploaded_file() threw no errors or warnings when
overwriting a file of the same name (kinda' scary, huh?) and type. I will
add a confirmation to ask "Hey, you know a file by that name exists already,
do you really want to replace it?". Maybe I should move a file to be updated
to a 'lower' folder as backup.

upload file?
   yes -> does file exist?
      yes -> is existing older?
         yes -> move to 'lower' directory, upload newer into current
directory

Opinions, ideas, criticisms?

Jay

***********************************************************
* Texas PHP Developers Conf  Spring 2003                  *
* T Bar M Resort & Conference Center                      *
* New Braunfels, Texas                                    *
* San Antonio Area PHP Developers Group                   *
* Interested? Contact [EMAIL PROTECTED] *
***********************************************************



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to