[PHP] Re: Can someone - anyone see my error?

2002-08-25 Thread Seairth Jacobs

I think you have to specify the destination file name as well.  The
destination directory is not enough.

---
Seairth Jacobs
[EMAIL PROTECTED]


Johnp [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Ok after being blasted for not looking on PHP.net first I have now returned
none the wiser! :D

Here is the post file:
-
form enctype=multipart/form-data action=postbit.php method=post
input type=hidden name=5400 value=1000
Send this file: input name=userfile type=file
input type=submit value=Send File
/form


Here is the post handler file:

?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILES  should be used instead of
$_FILES.
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
copy($_FILES['userfile']['tmp_name'],
/home/thehobby/public_html/php/phpforums/uploads/);
} else {
echo Possible file upload attack. Filename:  .
$_FILES['userfile']['name'];
}
/* ...or... */
move_uploaded_file($_FILES['userfile']['tmp_name'],
/home/thehobby/public_html/php/phpforums/uploads/);
?


And here is the error I get:
-
Warning: Unable to create
'/home/thehobby/public_html/php/phpforums/uploads/': Is a directory in
/home/thehobby/public_html/php/phpforums/forums/postbit.php on line 4

Warning: Unable to create
'/home/thehobby/public_html/php/phpforums/uploads/': Is a directory in
/home/thehobby/public_html/php/phpforums/forums/postbit.php on line 9

Warning: Unable to move '/tmp/phpahcXwh' to
'/home/thehobby/public_html/php/phpforums/uploads/' in
/home/thehobby/public_html/php/phpforums/forums/postbit.php on line 9





Anyone know whats going on - PHP.net was of a absolutely no use and I am
very new at file uploads - any help appreciated!
Thanks - John




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




[PHP] Re: Can someone - anyone see my error?

2002-08-25 Thread Eric Pignot

 form enctype=multipart/form-data action=postbit.php method=post
 input type=hidden name=5400 value=1000
 Send this file: input name=userfile type=file
 input type=submit value=Send File
 /form

I am not really replying to your question, but just as a remark, in php, a
variable needs to start with a letter or and underscire. (must be detailed
in the doc)
So I have absolutely no idea how PHP will interpret this line :
 input type=hidden name=5400 value=1000
(and I would be curious to know how it actually does ! can you tell me ? )

bye

Eric



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




Re: [PHP] Re: Can someone - anyone see my error?

2002-08-25 Thread Jason Reid

using register_globals=on and trying to echo out the $5400 errors as
expected, but php sees the correct entry in the $_GET superglobal array as
it should. running a simple foreach($_GET as $key = $val) returns a key of
5400 and a value of 1000 on a page with the querystring of
page.php?5400=1000, so you should be able to pull that info into another
variable correctly.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: Eric Pignot [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 25, 2002 7:24 PM
Subject: [PHP] Re: Can someone - anyone see my error?


  form enctype=multipart/form-data action=postbit.php method=post
  input type=hidden name=5400 value=1000
  Send this file: input name=userfile type=file
  input type=submit value=Send File
  /form

 I am not really replying to your question, but just as a remark, in php, a
 variable needs to start with a letter or and underscire. (must be detailed
 in the doc)
 So I have absolutely no idea how PHP will interpret this line :
  input type=hidden name=5400 value=1000
 (and I would be curious to know how it actually does ! can you tell me ? )

 bye

 Eric



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



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




Re: [PHP] Re: Can someone - anyone see my error?

2002-08-25 Thread @ Edwin
Just curious... Have you tried it with POSTed variables? As in the case 
mentioned?

Just wondering... Anyway, I'll try it myself later...

- E


using register_globals=on and trying to echo out the $5400 errors as
expected, but php sees the correct entry in the $_GET superglobal array as
it should. running a simple foreach($_GET as $key = $val) returns a key 
of
5400 and a value of 1000 on a page with the querystring of
page.php?5400=1000, so you should be able to pull that info into another
variable correctly.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "Eric Pignot" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 25, 2002 7:24 PM
Subject: [PHP] Re: Can someone - anyone see my error?


   form enctype="multipart/form-data" action="postbit.php" 
method="post"
   input type="hidden" name="5400" value="1000"
   Send this file: input name="userfile" type="file"
   input type="submit" value="Send File"
   /form
 
  I am not really replying to your question, but just as a remark, in 
php, a
  variable needs to start with a letter or and underscire. (must be 
detailed
  in the doc)
  So I have absolutely no idea how PHP will interpret this line :
   input type="hidden" name="5400" value="1000"
  (and I would be curious to know how it actually does ! can you tell me 
? )
 
  bye
 
  Eric
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php



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




_
$B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/


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