Using the FTP class to upload files from an upload form? can you do it?

#1
[eluser]Leggy[/eluser]
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?

#2
[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.

#3
[eluser]Seppo[/eluser]
Well... you should be able to move the temp file and you don't have to delete it...

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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