Friday, 6 September 2013

File/Directory mislocated [on hold]

File/Directory mislocated [on hold]

I have some truly bizarre behavior that I do not understand. I made a form
to upload files with. I used AJAX to call a php file which has some of the
following content:
$tmp_name=$_FILES['file']['tmp_name'];
$filename=$_FILES['file']['name'];
$newdir = 'new/file/path';
if(mkdir($newdir, 0777, true)) { echo 'Directory created'; }
if(is_dir($newdir)) { echo 'The directory exists'; }
$newfile = $newdir . '/' . $filename;
if(move_uploaded_file($tmp_name,$newfile)) { echo 'File moved' }
Now what is strange is when I execute this I get
Directory created
The directory exists
File moved
Yet when I go to this location I do not see a folder or file. SSH login as
root shows nothing either. I've used this method many times before and not
had this problem, with websites on the same server.

No comments:

Post a Comment