Re: existance of a file

From: John Dunlop (john+usenet_at_johndunlop.info)
Date: 02/25/04


Date: Tue, 24 Feb 2004 23:57:46 -0000

John Dunlop wrote:

> The file_exists function has already been suggested:

Well, I forgot that even if the file doesn't exist on your system, by
typing a filename in, a file is created and store in upload_tmp_dir.
Say I type in "C:\My Documents\file.txt" (possibly including the
quotes; presumably users are familiar enough with their browsers to
know how to handle them) and it doesn't exist, file information is
still stored in $_FILES, since $_FILES just contains POST data.
That's only logical.

The is_uploaded_file function therefore returns true; the
move_uploaded_file function moves the file; the original name,
temporary name, type and size are set; and no errors are given.
That's all to be expected.

The size is obviously 0. Maybe you could check that. Otherwise, I
don't believe there is any other tell-tale signs.

Ref.: http://www.ietf.org/rfc/rfc1867.txt

-- 
Jock


Relevant Pages