Giddy Rob Posted August 6, 2007 Share Posted August 6, 2007 Hey, I have a problem when I try and update and upload an xls file. It appears that the file has uploaded but when you try and download it its the contents is the same as the old file. Just to make sure it was working i tried it with a .txt file and it updated perfectly. Here is the code that I'm using to upload the files: $fileref=$_POST['updatefile']; $username=$_POST['username']; $password=$_POST['password']; if($_FILES['uploadfile']['name']!=""){ $oldfile=$_POST['oldfile']; $deletefile="../uploads/".$oldfile; unlink($deletefile); $file=$_FILES['uploadfile']['name']; $target_path = "../uploads/"; $target_path = $target_path . basename( $_FILES['uploadfile']['name']); $message = NULL; move_uploaded_file($_FILES['uploadfile']['tmp_name'], $target_path); $message="The file ". basename( $_FILES['uploadfile']['name'])." has been uploaded"; require_once('../../dbconnect/dbconnect.php'); $updatefile="UPDATE files SET username='$username', password='$password', filename='$file' WHERE refid='$fileref'"; $fileupdate=mysql_query($updatefile); Does anyone know why this might be happening? Might it be something to do with the server not the above code? Any help with this would be very much appreciated. Cheers Rob Quote Link to comment https://forums.phpfreaks.com/topic/63511-problem-uploading-updated-xls-files/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.