SFTP Transfer

Hi,

I’m kind of self teaching PHP as I go so forgive me if I sound like I don’t know what i’m talking about haha.

What I’m doing is building a SFTP file transfer system that runs on a cron job to export a file from one server to another. So far this works great, It creates the exported file and transfers accross no problem.

The issue I am having is where the file ends up. The server that I’m sending to (a client), I have no access to, which means that I do not know the file path to where I can access.

The code i’m using at the moment by default transfers the file to the root of the server. What i’m wondering is if there is a way that I can put the file in the place from the user login, not the server root.

The destination code I’m using is as follows.

[php]$dest = ‘/’$this->getFtpPath().$filename;[/php]

The FtpPath is being called from a GUI so basically I want the file path to go from where I login and not the root.

Sorry if it sounds all over the place, any other infomation I may have forgotten can be provided.

Thanks, Mike

There is a way to set the path, look at this site and scroll down a little to the 2nd or 3rd comment.
They talk about setting the path…

http://php.net/manual/en/function.ssh2-sftp.php

Sponsor our Newsletter | Privacy Policy | Terms of Service