Welcome Guest, Not a member yet? Register   Sign In
Using the FTP class to upload files from an upload form? can you do it?

I was just wondering, to make my image host more expandable I was thinking I could use the ftp class to upload files to the other server. But reading through the documentation it looks more like I have to upload the files then move the to another server and then delete the uploaded file on the current server.

What would you suggest?

[eluser]Jamie Rumbelow[/eluser]
If you take the variable that has the file path from the $_POST array that passes on the form stuff, then you should be able to do it with the usualy upload() method.

Just use the form helper instead of the upload library to process the form.

Well... you should be able to move the temp file and you don't have to delete it...

$this->ftp->upload($_FILES['userfile']['tmp_name'], '/public_html/uploads/' . basename($_FILES['userfile']['name']));

Theme © iAndrew 2016 - Forum software by © MyBB