hno Posted September 8, 2009 Share Posted September 8, 2009 HI I have a account in byethost.net and I want to upload some files using the CURL and FTP.The FTP address is:"ftp.byethost18.com" but I don't know what should I assign in the CURLOPT_URL for logging in to my account and upload some files to there.How shuld I give my ftp's username and password ? thanks Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/ Share on other sites More sharing options...
Garethp Posted September 8, 2009 Share Posted September 8, 2009 Why not just use the FTP functions? http://us3.php.net/manual/en/ref.ftp.php Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914496 Share on other sites More sharing options...
sKunKbad Posted September 8, 2009 Share Posted September 8, 2009 I've actually never used php's FTP, but I can't imagine it is very reliable. I have the hardest time with FTP reliability with FileZilla or SmartFTP. How could I trust php's FTP? Am I wrong about the reliability? Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914515 Share on other sites More sharing options...
0xyGen Posted September 8, 2009 Share Posted September 8, 2009 example codes : <?php $conn = ftp_connect("host.com"); $result = ftp_login($conn, "username", "password"); ftp_chdir($conn,"httpdocs"); // change dir if (ftp_mkdir($conn, "dirname")) { echo "Succeed"; } else { echo "problem"; } ftp_site($conn, 'CHMOD 0777 dirname'); // chmod 777 dir ftp_close($conn); ?> Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914566 Share on other sites More sharing options...
Garethp Posted September 8, 2009 Share Posted September 8, 2009 I've actually never used php's FTP, but I can't imagine it is very reliable. I have the hardest time with FTP reliability with FileZilla or SmartFTP. How could I trust php's FTP? Am I wrong about the reliability? No offense, but I'd most definitely say you're wrong, at least until you've tried it. Just because a few programs that use FTP aren't reliable doesn't mean that the language itself is unreliable. Bear in mind that this isn't a program with 101 bugs your talking about, it's an entire programming language. Yes, there may be a few bugs, but you can't judge a whole language by a few programs. It's like meeting a French person who doesn't speak French very well, so you decide French is a bad language. The person may not be good at the language, but that doesn't reflect upon the language itself. Besides, Filezilla and SmartFTP aren't written in PHP Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914577 Share on other sites More sharing options...
micmania1 Posted September 8, 2009 Share Posted September 8, 2009 I've used FTP functions a little but and they seemed fine to me. No problems as of yet. Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914651 Share on other sites More sharing options...
sKunKbad Posted September 8, 2009 Share Posted September 8, 2009 Garethp and micmania1, Thanks for your input. I'm going to have to try php FTP sometime. What Garethp said makes a lot of sense. I hope you can see why I've been nervous about using it. php is great, and if anyone could get it right, it would be php! Quote Link to comment https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/#findComment-914782 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.