PHP File Upload Restriction?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have the following code to handle file uploads.  There is a database
called "media".  The error I keep getting will follow the code.  The
upload data gets into the database fine; it seems to be storing the
file that causes a problem.  Please help!

$link = mysql_connect ( "localhost", "ninja999_tsql", "MYPASS")
    or die("Can't connect to database server");

mysql_select_db ("ninja999_testsql", $link)
    or die ("Unable to select database");


$query = "INSERT INTO `media` VALUES ('','$filename','$filetype')";
$result = mysql_query($query);
$query = "SELECT * FROM `media` WHERE `filename` = '$filename'";
$result = mysql_query($query);
$newname = mysql_result($result,0,"id");
move_uploaded_file( $filetempname, "PLACE/".$newname.".dat");
header( "location: PAGE.PHP" );


Warning: move_uploaded_file(): open_basedir restriction in effect.
File(PLACE/9.dat) is not within the allowed path(s): (BLAHBLAH/tmp) in
BLAHBLAH/upload.php on line 17

Re: PHP File Upload Restriction?

NinJA999 wrote:
Quoted text here. Click to load it

Check the directory you're trying to write the file to actually exists, is in a  
directory tree allowed by open_basedir (see php_info()) and has the same owner  
as the Apache process.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline