The problem is with the $uploadDirectory variable. If I change the $fVar1 to the name of a folder in my localhost the file will be saved correctly, however if it stays as $fVar1 the file doesn't save? Any idea what might be wrong?
Code: Select all
<?php
$fVar1 = $_POST['id'];
$fVar2 = $_POST['filename'];
$fVar3 = "test";
mkdir("$fVar1");
if (is_uploaded_file($_FILES['Filedata']['tmp_name'])){
$uploadDirectory="$fVar1/";
$uploadFile=$uploadDirectory.basename($_FILES['Filedata']['name']);
copy($_FILES['Filedata']['tmp_name'], $uploadFile);
}
?>Sluke