Jump to content

uploading help


azeem123456

Recommended Posts

hi i want to uplaod file  i am having problem in setting directory path

when u user press upload button  the fiile or image which user attached save on C:\wamp\www\pra\public\images 

could you tell me how to set this path

i an sucessful to save the file on c:\wamp\uploades_images with this code

here is code

$upload_errors= array
(UPLOAD_ERR_OK => "No errors.",
UPLOAD_ERR_INI_SIZE =>"Larger than upload_max_filesize.",
UPLOAD_ERR_FORM_SIZE =>"Lager than form MAX_FILE_SIZE.",
UPLOAD_ERR_PARTIAL=>"Partial upload.",
UPLOAD_ERR_NO_FILE=>"No file.",
//UPLOAD_ERR_N0_TMP_DIR =>"No temporary directory.",
UPLOAD_ERR_CANT_WRITE=>"Can't write to disk.",
UPLOAD_ERR_EXTENSION=>"File upload stopped by extension.");

if(isset($_POST['submit'])){
$tmp_file=$_FILES['file_upload']['tmp_name'];
$target_file= basename($_FILES['file_upload']['name']);
$upload_dir="uploads";
if(move_uploaded_file($tmp_file, $upload_dir."/".$target_file)){
$message="Uploaded sucessfully";

}else {
	$error=$_FILES['file_upload']['error'];
	$message=$upload_errors[$error];
}
}

kindly help me

?>

 

Link to comment
https://forums.phpfreaks.com/topic/204784-uploading-help/
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.