GetDotted Domains

Viewing Thread:
"FTP in PHP"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 03/10/03 at 15:00
Regular
"Pouch Ape"
Posts: 14,499
Hi.
I've probably asked about this before on my geeky travels, but I've come back to it again, as I want to use it for a Uni project.

My question is quite simple: How do I upload using PHP? And, can it be done on FREEOLA's servers?

I've had a quick go at it, but it didn't work. I think I'm confused about the connection ID/ftp_server thingies:

$ftp_server=" ";
$ftp_user_name=" ";
$ftp_user_pass=" ";
$source_file=stripslashes("$file_to_upload");
$destination_file=" ";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
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";
}
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if(!$upload)
{
echo "FTP upload has failed!";
}
else
{
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
ftp_close($conn_id);
?>

Can anyone shed any light on this please? Thanks in advance.
Fri 03/10/03 at 19:38
Regular
"Pouch Ape"
Posts: 14,499
Bah. Oh well, I suppose it's in their interests to do that.
Fri 03/10/03 at 18:25
Regular
"Eff, you see, kay?"
Posts: 14,156
Freeola won't let you use FTP scripts to dodgd connecting to their ISP to upload.
Fri 03/10/03 at 15:00
Regular
"Pouch Ape"
Posts: 14,499
Hi.
I've probably asked about this before on my geeky travels, but I've come back to it again, as I want to use it for a Uni project.

My question is quite simple: How do I upload using PHP? And, can it be done on FREEOLA's servers?

I've had a quick go at it, but it didn't work. I think I'm confused about the connection ID/ftp_server thingies:

$ftp_server=" ";
$ftp_user_name=" ";
$ftp_user_pass=" ";
$source_file=stripslashes("$file_to_upload");
$destination_file=" ";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
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";
}
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if(!$upload)
{
echo "FTP upload has failed!";
}
else
{
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
ftp_close($conn_id);
?>

Can anyone shed any light on this please? Thanks in advance.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Many thanks!
You were 100% right - great support!
Everybody thinks I am an IT genius...
Nothing but admiration. I have been complimented on the church site that I manage through you and everybody thinks I am an IT genius. Your support is unquestionably outstanding.
Brian

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.