Welcome Guest, Not a member yet? Register   Sign In
FTP class issues
#1

[eluser]sehummel[/eluser]
I am trying to use the FTP class to upload a file from my Mac. I have tried this code:

Code:
$this->CI->ftp->upload('/Volumes/Users/universal/Desktop/' . $file, '/public_html/downloads/service-ftp/' . $folder . '/' . $file, 'ascii', 0775);

$file and $folder both have the right values in my code. I read a post from Phil Sturgeon that you cannot upload a file from a local computer to the server. Is that true? If so, then what is the point in the FTP class?

I want to create a way for my users to upload files from their computers and want more flexibility than the file upload class gives. The FTP class does, but only if you can upload from a local computer.

One of my issues is getting the local path of the file. $_FILES does not give you a path, just a file name and tmp_name.
#2

[eluser]skunkbad[/eluser]
What errors are you getting?
#3

[eluser]sehummel[/eluser]
I figured it out. What you need to do is this:

Code:
public function upload($file, $folder) {
  $this->CI->ftp->upload($_FILES['file']['tmp_name'], '/public_html/rest/of/path/' . $_FILES['file']['name'], 'ascii', 0775);
}




Theme © iAndrew 2016 - Forum software by © MyBB