Drewser33 Posted February 28, 2008 Share Posted February 28, 2008 Here is the code I am using. As mentioned below the mkdir is working well but when I change the path to save to it does not go to that directory but adds the task to the filename instead of the path?? Any ideas? $task = $_GET['taskid']; $employeeid = $_GET['employeeid']; mkdir("uploads/$task"); //Working perfectly, creates the directory for each task under the folder uploads. $target_path = "uploads/$task"; //Not working, does not save the file inside this directory but adds the task to the file name. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { $filename = basename( $_FILES['uploadedfile']['name']); $query = "INSERT INTO tbluploads (taskid,filename) VALUES ('$task','/csPortal/task/uploads/$filename')"; mysql_query($query) or die(mysql_error()); ?> <tr> <td> <button onClick="window.location='taskhome.php?name=<?php echo $employeeid; ?>'">Continue</button> </td> </tr> <?php } else{ echo "There was an error uploading the file, please try again!"; } THANKS for all the help Link to comment https://forums.phpfreaks.com/topic/93521-upload-file-path-not-changing/ Share on other sites More sharing options...
Drewser33 Posted February 28, 2008 Author Share Posted February 28, 2008 I don't know how to mark this solved, but I figured it out. Thanks Link to comment https://forums.phpfreaks.com/topic/93521-upload-file-path-not-changing/#findComment-479181 Share on other sites More sharing options...
EKsparky Posted February 28, 2008 Share Posted February 28, 2008 I think i have the same problem how did you solve it ? http://www.phpfreaks.com/forums/index.php/topic,184779.0.html Thanks Link to comment https://forums.phpfreaks.com/topic/93521-upload-file-path-not-changing/#findComment-479599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.