Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-28 Thread Dave
Jon, As recommended before, I have added global $HTTP_POST_FILES; to my function. The upload directory has a permission setting of 777 and the directory specified ends in a slash.I don't know what the server logs say, however, as I don't know where they are or how to check them. I am, after

Re: [PHP] [NEWBIE] Trying to create a function from an existing script [SOLVED]

2005-01-28 Thread Dave
Jon and all, Please disregard my posting just before this. After a night's sleep and looking at my code with fresh eyes, I noticed that I had an extra under bar character in my $HTTP_POST_FILES variable which was causing all the trouble. The script is now working perfectly. Thanks

[PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Dave
PHP List, The Situation: I'm trying to make a page where users can upload an image. I've located on the internet a script that is simple enough for me to use, and I can build upon it to customize for my needs. The script as it is on the web site I got it from is a stand alone .php file

RE: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Mike Johnson
From: Dave [mailto:[EMAIL PROTECTED] The Problem: I'm not able to create the right syntax to pass the $HTTP_POST_FILES variable to the function. So the function gets called, but then it stops very early because what I end up giving it is essentially an empty array, so it thinks

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Marek Kilimajer
Dave wrote: PHP List, The Situation: I'm trying to make a page where users can upload an image. I've located on the internet a script that is simple enough for me to use, and I can build upon it to customize for my needs. The script as it is on the web site I got it from is a stand

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Dave
Marek, Mark, Thanks for the advice. I've added global $HTTP_POST_FILES; into my function, and it is working. I'd also like to follow Marek's advice to modify my script, as it sounds like it helps to make it more secure. However, I don't think I'm using the syntax right. I changed: if(

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Josip Dzolonga
On Fri, 2005-01-28 at 14:41 +0900, Dave wrote: if ( move_uploaded_file($HTTP_POST_FILES[$name]['tmp_name'], $store_dir . basename($HTTP_POST_FILES[$name]['name']) ) Try echoing $store_dir . basename($HTTP_POST_FILES[$name]['name'] before uploading the file (before the move_uploaded_file

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Jon
basename is looking for a file and $HTTP_POST_FILES[$name]['name'] is not a valid path to a file. Something like this should work if(move_uploaded_file($_HTTP_POST_FILES['upfile']['tmp_name'], rawurlencode($store_dir.$HTTP_POST_FILES['upfile']['name'])) On Fri, 2005-01-28 at 14:41 +0900, Dave

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Dave
Jon, Thanks for responding. Unfortunately, it still doesn't work. I tried it exactly as you wrote, and it still gives me the message that it failed to upload. Also, I actually want to force a name change to the file, so that regardless of what the name of the file uploaded is, it gets

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Jon
Dave, Does $store_dir end with a slash? Is it writable by apache? What do your log files reveal? What is the output of the script? On Fri, 2005-01-28 at 15:18 +0900, Dave wrote: Jon, Thanks for responding. Unfortunately, it still doesn't work. I tried it exactly as you wrote,

Re: [PHP] [NEWBIE] Trying to create a function from an existing script

2005-01-27 Thread Jon
Dave, Another quick note. If you are using this in a function with register_globals off in you php.conf you will need to do global $_HTTP_POST_FILES or use $_FILES['upfile']['temp_name'] instead. On Fri, 2005-01-28 at 15:18 +0900, Dave wrote: Jon, Thanks for responding. Unfortunately, it