user1238784
user1238784

Reputation: 2440

move_uploaded_file returns true but file does not appear in folder

I have a couple of scripts that worked fine on another server.

Now that I have moved everything on to a new server, the file does not appear in the destination folder. The strange thing is that move_uploaded_file returns true.

Also, I printed the post data and there is no error.

Can you guess what's possibly going on. The files I am trying to upload as a test are very small ( 10 kb).

Upvotes: 3

Views: 4250

Answers (2)

nightcoder
nightcoder

Reputation: 13509

In my case, Total Commander, used as an FTP client, truncated output to 10000 files in directory. When I connected via SSH using WinSCP I was able to see all ~14000 files in the directory.

Upvotes: 1

Bob Fanger
Bob Fanger

Reputation: 29897

The move likely succeeded, check the following:

  • You don't have access to view the file.
    Use chmod("/path/to/file.ext", 0755); to add view rights for the ftp user.
  • You moved the file to an location that doesn't store the file. /dev/null
  • You're looking in the wrong folder. Did you use a full path?
  • The file is removed shortly after the move.

Upvotes: 3

Related Questions