|
Posted by Rik on 01/19/07 13:10
rfhurley wrote:
> move_uploaded_file($_FILES["file"]["tmp_name"],
> "upload/" . $_FILES["file"]["name"]);
> the problem is, that I can't find my file "red.jpg", or
> "upload/red.jpg"-- or even a folder marked "upload/"-- anywhere on my
> server. Am I missing something? (well, <i>obviously...</i>)
Yes, you should:
1. Create a directory to which you want to move the uploaded files.
2. Chmod this to 0766 (or 0777).
3.
move_uploaded_file($_FILES["file"]["tmp_name"],'/the/path/you/chose/'.$_FIL
ES["file"]["name"]);
Also, temporarily enable error reporting (do not do this on a live
environment..) so you can see it if move_uploaded_file fails and how.
<?php
ini_set('display_errors',true);
error_reporting(E_ALL);
?>
(possibly to error_reporting(E_ALL|E_STRICT); if you're in the mood for
cleaning bad habits in code.)
--
Rik Wasmus
[Back to original message]
|