PHP file uploads problem ...
Hi all,
i am learning php and have a small problem with uploading files. Here is what i have : Code:
$uploadDir="/home/mike/www/uploads/"; Not uploaded ! Name :/home/mike/www/uploads/phpMJsUbD Error code :0 <------------------------------- error code is ok . Array ( [userfile] => Array ( [name] => cv.txt [type] => text/plain [tmp_name] => /home/mike/www/uploads/phpMJsUbD [error] => 0 [size] => 808 ) ) My php.ini file looks like this : ;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = "/home/mike/www/uploads" <------------------------------------- ; Maximum allowed size for uploaded files. upload_max_filesize = 2M Cant see any files in the upload directory ;(.Anyone ? |
I can tell you've been there already, but go read it again. The php.net doc on dealing with file uploads covers exactly what you're trynig to do.
You're biggest problem here though is that you're checking $_FILES["userfile"]["name"] with is_uploaded_file, and then printing $_FILES["userfile"]["tmp_name"]. If you want to check existance of $_FILES["userfile"]["name"], you have to copy() $_FILES["userfile"]["tmp_name"] to $_FILES["userfile"]["name"]. |
move_uploaded_files would also produce the same results
|
Quote:
Yeah , i have got it now .Thanks :-). |
All times are GMT -5. The time now is 08:37 PM. |