Jump to content

PHP FTP


johnsoce

Recommended Posts

Hi,

 

I'm trying to FTP files to an online file storage system through PHP, and I've determined that my hosting company (GoDaddy) does not allow this type of FTP access. (They only allow access from ftp client programs or through web browsers).

 

Do any of you have suggestions for other online file storage systems or hosting companies that allow FTP through PHP? I'm starting to determine there must not be many out there through the research I've already done. I figure someone in this forum has a good recommendation from past experiences.

 

Regards,

Chris

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/
Share on other sites

How did you determine that your provider does not accept FTP access from a PHP-client?

 

If you wrote a PHP-script, did you try that script on another site? (to KNOW for sure its OK)

 

Can/Will you post your FTP-script here?

 

Because, in my opinion, there is no way (and/or no use) to block the PHP-client, and allow other clients and browsers....

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/#findComment-1021527
Share on other sites

I actually was told by a GoDaddy support rep that FTP through PHP has been disabled. 

 

Here is the script I used:

 

// set up basic connection and login

$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_password);

 

// check connection

if ((!$conn_id) || (!$login_result)) {

echo "FTP connection has failed!";

echo "Attempted to connect to $ftp_server for user $ftp_user_name";

exit;

} else {

echo "Connected to $ftp_server, for user $ftp_user_name";

}

 

 

 

When I run the script, this is the following output:

 

Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/content/69/5335269/html/transferToFileFolder.php on line 9

 

Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/content/69/5335269/html/transferToFileFolder.php on line 10

 

FTP connection has failed!Attempted to connect to for user

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/#findComment-1021529
Share on other sites

Lets see if I understand.

 

1. Your website is hosted by Godaddy.

2. You storage is within your hosted site at godaddy

3. the script you are testing is on your hosted site with godaddy

4. your script is using ftp to put a file from your website to your storage on the same site.

 

Do I have it right, if not correct the ones that are wrong.

 

 

HTH

Teamatomic

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/#findComment-1021530
Share on other sites

Yes, you are correct on it all. 

 

You know, I haven't even gotten to try to actually put a file up using FTP because they don't even let me connect.  I've talked to their support and they admit their security prohibits any of the FTP'ing through PHP.  That's why I was hoping to move on to another online file storage company that allows this feature.

 

By the way, the reason why having the ability to FTP through PHP is so important to me is because I am reading/writing a large number of files and the current method that I use is through a MySQL database, which works great, except that the size is limited to 1GB and I require probably something in the range of 50GB.  That's why I am looking to re-architect my site so that I can move from a database system to an online file storage system.

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/#findComment-1021537
Share on other sites

Does Gmail allow FTP through PHP scripts?  Because I have purchased additional space that theoretically would be sufficient.

 

sorry, i forgot the smilie after my last post.  :D

 

But seriously, i think you are trying to solve your problem the wrong way

I suggest you start looking for a web-host who provides enough space to store your data in a database,

(or store it locally, on the same server as where the web-application is.)

Link to comment
https://forums.phpfreaks.com/topic/194152-php-ftp/#findComment-1021604
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.