Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    9

    Unanswered: Check whether file exist when upload file

    I use the following code to upload file:
    --------------------------------------------------------------
    $filename="project_ID/$uploadfile";

    if (file_exists($filemane))
    {
    echo "File already exist";
    exit;
    }

    if(copy($uploadfile, "project_ID/$uploadfile_name"))
    {
    echo "OK";
    }
    else
    {
    echo "fail";
    }
    ----------------------------------------------------------------
    However, the program can upload file but can't check whether the file exist. Can anyone help me to correct it?

  2. #2
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    it looks like its already there, however the variable seems to be misspelled.
    Mr. Lars

  3. #3
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482
    Originally posted by lslars31
    it looks like its already there, however the variable seems to be misspelled.
    This is right or it is a mistake (i mean fileMANe)?

    if (file_exists($filemane))

  4. #4
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    shouldn't it be "$filename"?
    Mr. Lars

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •