I encountered the same problem recently while working on my sites Fan Art section. 
There's a small error in the PHP manual which solves your problem.

With the move_uploaded_file(); function, in the end string you need to put the 
actual file name as well..

e.g:
$filename = $_FILES['userfile']['name'];
$path = $_SERVER["DOCUMENT_ROOT"]."/fanart/art/".$uid2."/".$filename;
$tmpname = $_FILES['userfile']['tmp_name'];
move_uploaded_file($tmpname, $path);

So in your case it would be:

 move_uploaded_file($_FILES['userfile']['tmp_name'], "/".$_FILES['userfile']['name']);

I believe this should solve the problem, other wise i just pointed out something to 
fix 
^^;

- Daniel "TheHeadSage" Spain
Founder of Voidsoft.
Head of IRC Relations for Manga-Sketchbook.Org

On 20 Jan 2003 at 11:55, Matt Babineau wrote:

> Here is the error:
>  
> PHP Warning: move_uploaded_file(/) [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: failed to create
> stream: No such file or directory in
> D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22 PHP Warning: move_uploaded_file()
> [function.move-uploaded-file
> <http://www.php.net/function.move-uploaded-file> ]: Unable to move
> 'd:\Temp\php443.tmp' to '/' in
> D:\wwwroot\kingmanchamber\secure-area\administration\upload\file_upload.
> php on line 22 
>  
> Here is the code:
>  
> <form enctype="multipart/form-data" action="<? echo
> $_SERVER['SCRIPT_NAME'];?>" method="post">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send File">
> </form>
>  
> <?
> if ($_SERVER['REQUEST_METHOD'] == "POST") {
>  echo $_FILES['userfile']['name'] . "<BR>";
>  echo $_FILES['userfile']['tmp_name'] . "<BR>";
>  
>  move_uploaded_file($_FILES['userfile']['tmp_name'], "/");
>  
>  }
> ?>
>  
> I am running this on a winxp pro machine iis 5.1, php 4.3.0 running as a
> CGI.
>  
> This code is pretty much from the PHP.net site, so I am a tad baffled on
> this one.
>  
> -Matt
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to