hi
Firstly i am working with php in an enviroment that supports unix-like
permission in an accademic environment.
The problem is enabling my script to upload a image file to my home folder,
called say photoFinalDesti nation.
so far i have set up my groups to 'www' with read, write and execute
permissions on the folder photoFinalDesti nation from within unix
my php script is the template from php.net obviously modified for my
filenames and stuff.
<?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILE S should be used instead of
// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_fil e()
// instead of move_uploaded_f ile
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_ file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES );
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES );
}
print "</pre>";
?>I can definatly upload to the temprary file on the server but i cannot
'move_uploaded_ file()' to my folder photoFinalDesti nation.The version of PHP
is 4.3.3 and its running on a apache server.Any and all help
appreciated.sea n
Firstly i am working with php in an enviroment that supports unix-like
permission in an accademic environment.
The problem is enabling my script to upload a image file to my home folder,
called say photoFinalDesti nation.
so far i have set up my groups to 'www' with read, write and execute
permissions on the folder photoFinalDesti nation from within unix
my php script is the template from php.net obviously modified for my
filenames and stuff.
<?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILE S should be used instead of
// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_fil e()
// instead of move_uploaded_f ile
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_ file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES );
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES );
}
print "</pre>";
?>I can definatly upload to the temprary file on the server but i cannot
'move_uploaded_ file()' to my folder photoFinalDesti nation.The version of PHP
is 4.3.3 and its running on a apache server.Any and all help
appreciated.sea n
Comment