I’m trying to upload a file but i doesnt work:
Usefull Info: Running IIS Express (with PHP 5.3) – Windows 7 Professional 32 Bits
Code:
move_uploaded_file($_FILES[“imagem”][“name”], “/images/” . $_FILES[“imagem”][“name”]) or die (“Error:”.print_r($_FILES));
It Prints: Array ( [imagem] => Array ( [name] => Chrysanthemum.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php3D85.tmp [error] => 0 [size] => 879394 ) )
I’m sure the path is correct and i also did chmod() to set permissions but still, doesn’t upload.
Any sugestions?
Your destination path should start with a proper path to the images directory (
dirname(__FILE__)can help). As it stands,"/images/" . $_FILES["imagem"]["name"]means it’ll try to write toC:/images/(assuming the script is in theC:drive) which probably doesn’t exist.