[eluser]Phil Sturgeon[/eluser]
Right, having a bad day with some FTP and need a spot of help if you can.
I have added a FTP download function into my MY_FTP class to download from one server to my local one. However the code below:
Code:
function download($rempath, $locpath, $mode = 'auto')
{
if ( ! $this->_is_conn())
{
return FALSE;
}
// Set the mode if not specified
if ($mode == 'auto')
{
// Get the file extension so we can set the upload type
$ext = $this->_getext($rempath);
$mode = $this->_settype($ext);
}
$mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY;
$result = ftp_get($this->conn_id, $locpath, $rempath, $mode);
if ($result === FALSE)
{
if ($this->debug == TRUE)
{
$this->_error('ftp_unable_to_download');
}
return FALSE;
}
return TRUE;
}
Returns the error:
Quote:Severity: Warning
Message: ftp_get() [function.ftp-get]: open_basedir restriction in effect. File(/public_html/tmp/7782c5f1954255628bb10c26d8a4597f.flv) is not within the allowed path(s): (/home/engage5d:/usr/lib/php:/usr/local/lib/php:/tmp)
Filename: libraries/MY_Ftp.php
However it shouldnt be complaining about /public_html/tmp/7782c5f1954255628bb10c26d8a4597f.flv as im trying to grab the file from the flash media server, which is /sdfskfhsj/vportal1/streams/_definst_/ so... what the hell? How do I fix this error?
Also, why does the code:
Code:
$this->ftp->upload('/public_html/tmp/7782c5f1954255628bb10c26d8a4597f.flv',
$this->config->item('video_folder').'7782c5f1954255628bb10c26d8a4597f.flv');
give me a "cant find source file" error when im bloody certain that file is there?!! The remote folder may be incorrect, but the local folder is damn right!