azeem123456 Posted June 14, 2010 Share Posted June 14, 2010 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 ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.