hello friends,
Good Morning ,
i require code for saving path of file in database can any one provide me.

Thank u
Rakesh Nagekar

Recommended Answers

All 2 Replies

This code is works for me finely...You also try it....

if($HTTP_POST_FILES["rfile"]["size"] >1) {	 // for  large image 1
			$ext = substr($HTTP_POST_FILES['rfile']['name'],strpos($HTTP_POST_FILES['rfile']['name'],'.')+1);
			$ext_arr=array("txt","rtf","doc","pdf","rar","zip");
			//if (in_array($ext,$ext_arr)) { 			
				$pfile=substr($HTTP_POST_FILES['rfile']['name'],0,strpos($HTTP_POST_FILES['rfile']['name'],'.'));
				$pfile.=time();
				$pfile.=strstr($HTTP_POST_FILES['rfile']['name'],'.'); 	
				$pfile="resumes/".$pfile;			
				if(!move_uploaded_file($HTTP_POST_FILES['rfile']['tmp_name'],$pfile))
				 { $pfile=""; }
				chmod($pfile,0777); 				
			} else {		
				$pfile="";
			}

You must use this term in you form tag;;
enctype="multipart/form-data"


k...

Just don't use $HTTP_POST_FILES, sinces that's deprecated. You can just use $_FILES instead.

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.