php upload problem with http_post_files

Mark Hughes mh_lists at digitalspy.co.uk
Mon Jul 1 12:02:21 BST 2002


> does anyone know why this is happening?
>
> I'm trying to upload files through the browser.
>
> I've just tried to use the $http_post_files global variable like this:-
>
> copy ($HTTP_POST_FILES[$photo], "$dir/1") or die("<html><body
> bgcolor=#ffffff background=../../../Images/background.gif
> text=#000000><center><font face=Arial, Helvetica, sans-serif size=2>The
file
> you are trying to upload couldn't be copied to the server as it already
> exists<br> click <a href=index.php> here </a> to return to menu and try
> again</center></body></html>");
>
> and I'm getting:-
>
> "Warning: Unable to open '' for reading: No such file or directory in"
when
> I test it in a browser

What permissions does the apache user (if you're using mod_php4) or the PHP
user (if using the standalone PHP) have for $dir? I've normally found that
it's usually easiest to have the directory world-writable (it's a pretty
closed server we operate anyway so that's not a problem for us - probably
isn't recommended in most situations though).

> is there some variable in the php.ini I need to turn on/off because I've
> installed the php myself on a unix server

I think there is, but I think it's on by default - have a look on google
about it.

HTH,
Mark





More information about the Ukfreebsd mailing list