Jump to content

Recommended Posts

 

 

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

Link to comment
https://forums.phpfreaks.com/topic/173492-how-to-use-ftp-with-curl/
Share on other sites

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);

?> 

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

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.