By default, your webserver doesnt have permissions to write to directories
other than /tmp or /temp.
File uploads as you discovered are placed in the temp directories first,
then you have to copy them to a storage directory accessible to your server
- though I recommend placing it outside
Hi all
I am trying to upload a file. It works fine on my local Apache, but
gives me Permission denied to create file error on my online host..
Any clue???
$file = $_FILES['userfile']['tmp_name'];
if (is_uploaded_file($file))
print_r(Copying .$file);
if (copy($file, ./files/.
I want to measure how much space is used by a
specific dir and echo it out
e.g.
/home/avalanche = 10mb
/home/damouse = 188kb
/home/pests == 20kb
Ensign BakerHCO
OfficerUSS Atlantis
DaMouse,
Here is a copy of a previous mail for a related problem, with filesizes and
a little arithmetic you should be able to adapt this to your needs
(Copy of mail to Darren)
Darren,
As others have said, PHP is not really the right tool for client side work
even if the client machine is also
php-windows Digest 24 Nov 2002 22:44:01 - Issue 1455
Topics (messages 17095 through 17098):
Re: Subject: Help required... Simple File Upload
17095 by: Neil Smith
Unable to upload.. :(
17096 by: toby z
measuring space
17097 by: DaMouse
17098 by: Cam Dunstan
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
Toby,
Your ISP may be using 'safe_mode'. Try the move_uploaded_file function()
instead of copy(). This is taken off php.net/move_uploaded_file:
Note: move_uploaded_file() is not affected by the normal safe-mode
UID-restrictions. This is not unsafe because move_uploaded_file() only
ok... so last weeks struggle was getting my computer set up as a php mysql
server for testing. I guess it was also a struggle learning how to install
my first precoded program. With that being said, I am very grateful for
all for the help that you here in this forum gave me.
I have now given
/*
i m now using the following script to upload the file but
still it is not working..
I there would've been some permission problem , i have given
full control permission to the whold directory even the drive there
the site is hosted.
now the script is generating the following out put
which
This thread is from alt.comp.lang.php
Anyone have a definitave answer for this, and not a work-around ?
Mark...
Update,
Have got a work-around happening... I insert this in the headers:
\nDate: .date(D, d M Y H:i:s O)
This seems to work. There are quite a few instances of this type of
$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);
Well after a bit of struggle i got the solve to the problem
Now whether there was my misinterpretation, or the incmplete documentation of the php
manual that I was using it with the following example
?php // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
$_FILES.if
12 matches
Mail list logo