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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.