sluke101 Posted March 30, 2009 Share Posted March 30, 2009 Hiya I'm having trouble modifying getting the below code to work. It's basicaly the php code to a flash picture upload tutorial. 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? 1. <?php 2. 3. $fVar1 = $_POST['id']; 4. $fVar2 = $_POST['filename']; 5. $fVar3 = "test"; 6. 7. mkdir("$fVar1"); 8. 9. if (is_uploaded_file($_FILES['Filedata']['tmp_name'])){ 10. 11. $uploadDirectory="$fVar1/"; 12. $uploadFile=$uploadDirectory.basename($_FILES['Filedata']['name']); 13. 14. copy($_FILES['Filedata']['tmp_name'], $uploadFile); 15. 16. } 17. ?> Cheers in advance Sluke Link to comment https://forums.phpfreaks.com/topic/151678-problem-saving-into-folder-name-declared-as-variablevdxdf/ Share on other sites More sharing options...
FaT3oYCG Posted March 30, 2009 Share Posted March 30, 2009 try 1. <?php 2. 3. $fVar1 = $_POST['id']; 4. $fVar2 = $_POST['filename']; 5. $fVar3 = "test"; 6. 7. mkdir($fVar1); 8. 9. if (is_uploaded_file($_FILES['Filedata']['tmp_name'])){ 10. 11. $uploadDirectory="$fVar1" . "/"; 12. $uploadFile=$uploadDirectory.basename($_FILES['Filedata']['name']); 13. 14. copy($_FILES['Filedata']['tmp_name'], $uploadFile); 15. 16. } 17. ?> Link to comment https://forums.phpfreaks.com/topic/151678-problem-saving-into-folder-name-declared-as-variablevdxdf/#findComment-796517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.