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

[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:

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)
            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:


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!

Okay, calm down pyro, we don't want you starting any fires now. :-)

I'll do some digging around for you.


I'm concerned about that leading slash. That might be telling the FTP server to start at the root, and look for a folder called "public_html". Try removing that leading slash to see if there's any improvement.

[eluser]Phil Sturgeon[/eluser]
In both cases (upload and download) no trailing slash has no effect.

// Upload video to Media Server

List files works but the other two give me constant crap (obviously im only running one at a time, commenting the others out).

You say the "list" works, but what the heck is the deal with this path:

Why the forward and backward slashes?

Are you still getting the "open_basedir restriction in effect" in both cases? Please elaborate on what you get for downloading, and what you get for uploading, separately.

Have you researched the "open_basedir restriction in effect" issue? There's plenty online about it.

[eluser]Phil Sturgeon[/eluser]
Thats the media server im connecting too. I want to move a flv file from in there, to the /public_html/tmp/ on my server. I also need to be able to upload to that server too, but cant get files going either way!

Have you tried setting open_basedir in your conf to none?

I hate open_basedir with a passion.

FTP. Grrr.

Anyone still working on the IPoAC CI library?

[eluser]Phil Sturgeon[/eluser]
Carrier pidgeon might be quicker than this crap.

OK, lets start with why I cant upload. If I connect to my local server as the FTP server and do this...


then I see all my files, includuing 7782c5f1954255628bb10c26d8a4597f.flv. If I copy that exact path in, and connect to the media server in FTP then it says "Unable to find source". Which makes me think... wtf?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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