northernmics Posted May 21, 2007 Share Posted May 21, 2007 The following code pulls the variables from a flash movie. <?php $folder = $_POST['folder']; $path = "./files/".$folder."/"; //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files/".$folder)) mkdir("./files/".$folder, 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], $path.$_FILES['Filedata']['name']); chmod($path.$_FILES['Filedata']['name'], 0777); ?> The $folder variable contains the username, the purpose is to create a user folder and move the uploaded image to it. This scriipt creates the proper folder " ./files/username/" but the image moves to " ./files/ " instead of the username folder. The code looks to be the same for both mkdir and move_uploaded_file, and Im confused why it is not working. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.