Hi,

I'm having a very strange problem. I use lampp on centOS linux. My application has a upload Script (in PHP) which uploads file to file system. after upload and moving file to correct location, uploaded files are getting deleted. I check file upload and moving of file by putting all the status in a text log file. files are getting uploaded properly and after upload I'm able to move the files to it's correct location.

thanks,
Jitender Aryan

I believe you problem is you are looking in the wrong spot. It looks to me like the file in your screenshot was uploaded to /web/htdocs/m/s/41/f/793/f41-793.ogg, but I can't tell. Could we see some code so that we can determine where the files are going. Also, I would add an index to pnp.bojam.com/php because any client can view the file listing for that directory. EDIT: For now though, if you don't mind: please don't create an index so that I can take a look at your file structure. You can add an index after you problem is solved!

Please see the attached file for the code I used to upload files.

It doesn't appear that you accidentally delete the song file in that code, nor do I spot any problems. I believe we need to see where you define your class "general" (Taking a good guess I would say that's in models/general.php).

I have attached code block (general class) which uploads the file and also the code block of validations class which checks and validates the uploaded file.

I would like to tell you that we have 3 servers on two servers same code is working fine but not on the third one.

thanks,
Jitender Aryan

Well there is a problem with the general file. It seems like you have too many brackets. See below:

function uploadFile($fld,$name,$path){
	$file=new validations();
	//var_dump($_FILES[$fld]);
	switch($_FILES[$fld]['error']){
		case 0:
			if($file->validateFile($fld)){//if valid file
					if(move_uploaded_file($_FILES[$fld]['tmp_name'],$path."/".$name)) $this->message="Track Uploaded!!!";
			} else { //if not valid file
				$this->message="Uploaded file in not Valid!!!".$file->result;
			}
			break;
		case 1:
			$this->message="Upload File exceeded Maximum file size allowed by the server.";
			break;
		case 2:
			$this->message="Upload File exceeded Maximum file size allowed.";
			break;
		case 3:
			$this->message="Uploaded file was only partially uploaded.";
			break;
		case 4:
			$this->message="No File Uploaded.";
			break;
		case 6:
			$this->message="Temporary file folder missing.";
			break;
		case 7:
			$this->message="Failed to write file to disk.";
			break;
		case 8:
			$this->message="File upload stopped due to extension.";
			break;
	}
	return $this->message;	

//Whats all this down here!!
	}ield; //Whats ield;
		return false;
		}	
	}

What's with the stuff at the end? Also, it would be helpful to see the move_uploaded_file() function...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.