Jump to content

problem uploading updated xls files


Giddy Rob

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/63511-problem-uploading-updated-xls-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.