• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stupid FTP Grr

#1
[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!


Messages In This Thread
Stupid FTP Grr - by El Forum - 07-31-2007, 05:49 PM
Stupid FTP Grr - by El Forum - 07-31-2007, 06:22 PM
Stupid FTP Grr - by El Forum - 07-31-2007, 06:26 PM
Stupid FTP Grr - by El Forum - 08-01-2007, 04:28 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 07:59 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 08:02 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 08:03 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 09:37 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 09:47 AM
Stupid FTP Grr - by El Forum - 08-01-2007, 12:14 PM
Stupid FTP Grr - by El Forum - 08-01-2007, 12:20 PM
Stupid FTP Grr - by El Forum - 08-01-2007, 12:27 PM
Stupid FTP Grr - by El Forum - 08-08-2007, 07:11 AM
Stupid FTP Grr - by El Forum - 08-08-2007, 07:42 AM
Stupid FTP Grr - by El Forum - 08-08-2007, 07:57 AM
Stupid FTP Grr - by El Forum - 08-08-2007, 08:25 AM
Stupid FTP Grr - by El Forum - 08-08-2007, 08:30 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.