Re: Help required... Simple File Upload
| From: | Raheel Hussain | Date: | Mon, 25 Nov 2002 07:28:39 +0000 |
| Subject: | Re: Help required... Simple File Upload | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17105@lists.php.net to get a copy of this message | ||
$file = $_FILES['userfile']['tmp_name'];
print_r($file . "<Br>");
print($_FILES['userfile']['size'] . "<br>");
move_uploaded_file($file, "/Uploads");
/*
gives the following output
d:\raheel\w3sites\phpDE.tmp
73699
*/
/*
$file = $_FILES['userfile']['tmp_name'];
print_r($file . "<Br>");
print($_FILES['userfile']['size'] . "<br>");
move_uploaded_file($file, "d:\\raheel\\w3sites\\txtfiledemo\\uploads\\");
give the following output
d:\raheel\w3sites\phpE3.tmp
73699
Warning: Unable to create 'd:\raheel\w3sites\txtfiledemo\uploads\': Permission denied in
D:\Raheel\W3sites\txtfiledemo\default2.php on line 25
Warning: Unable to move 'd:\raheel\w3sites\phpE3.tmp' to
'd:\raheel\w3sites\txtfiledemo\uploads\' in D:\Raheel\W3sites\txtfiledemo\default2.php on
line 25
*/
Dash McElroy <php@l1te.net> wrote:I haven't done but one file upload, but it seems from
the error message
that maybe PHP is trying to write the file to
d:\raheel\w3sites\txtfiledemo\uploads\ (as a file?). Perhaps you should
include the $_FILES['userfile']['name'] to the ending statement (which I
believe is what the file's original name was).
Worth a try at least. (I may be wrong on the $_FILES['userfile']['name'] -
try print_r($_FILES); and see what is in that array).
-Dash
Fashion is a form of ugliness so intolerable that we have to alter it
every six months.
-- Oscar Wilde
On Sat, 23 Nov 2002, Raheel Hussain wrote:
>
> hi,
> I got a problem in a simple file upload in a php file , i have two pages and i m writing the
> code here as bellow
>
> ::page1.php::
>
>
>
>
>
> [input]
> Send this file: [input]
> [input]
>
>
>
>
> ::default2.php::
> move_uploaded_file($_FILES['userfile']['tmp_name'],
> "D:\\Raheel\\W3sites\\txtfiledemo\\uploads\\");
> print($_FILES['userfile']['error']);
>
>
> :: on default2.php i have the following error, which i can't figure out ::
>
> Warning: Unable to create 'D:\W3sites\txtfiledemo\uploads\': Permission denied in
> D:\W3sites\txtfiledemo\default2.php on line 9
>
> Warning: Unable to move 'c:\php\uploads\php76.tmp' to
> 'D:\W3sites\txtfiledemo\uploads\' in D:\W3sites\txtfiledemo\default2.php on line 9
> 0
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now