GetDotted Domains

Viewing Thread:
"PHP ftp_put command..."

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.

Thu 12/08/04 at 11:24
Regular
"Pouch Ape"
Posts: 14,499

$new_file_name = "filename.jpg";

$file_a = "$form_image_a";
$remote_file = "$new_file_name";
$ftp_host = "hostname";
$conn_id = ftp_connect($ftp_host);

$ftp_user_name = "username";
$ftp_user_pass = "password";

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

if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))
{ print("Successfully uploaded $file_a \n"); }
else
{ print("There was a problem while uploading $file_a \n"); }

ftp_close($conn_id);

?>


What's wrong with that? Please.
Fri 20/08/04 at 10:40
Regular
"Pouch Ape"
Posts: 14,499
Whoop-de-doo, I did it!

Can finally get this project finished now!

And use more exclamation marks in sentences!
Mon 16/08/04 at 18:59
Regular
"Pouch Ape"
Posts: 14,499
I switched passive to true, and my home PC actually hasn't got a firewall!!!!
Mon 16/08/04 at 18:56
Regular
"Devil in disguise"
Posts: 3,151
Well, would help to know the results of doc693's suggestions. $conn_id and $login_result definitely aren't false?

Assuming they are true, first thing I'd try is
ftp_pasv($conn_id, true);
after the ftp_login. Might be you have firewall problems.
Mon 16/08/04 at 15:24
Regular
"Pouch Ape"
Posts: 14,499
Any more (sober) suggestions for this? I had a tinker, and got up all sorts of error messages, but the closest I've got is making the built-in error message come up again. It's annoying, because it's the only thing holding up my client's site.
Sat 14/08/04 at 01:35
Regular
Posts: 2,849
Shush woman, when i can thinkg porperly and type properly I can code as well, dude,
Sat 14/08/04 at 01:33
Regular
"Pouch Ape"
Posts: 14,499
Icarus mk2 wrote:
> Woah , i regret looking at this now.

Ha ha. Behold, the realm of geeks and nerds.
Sat 14/08/04 at 01:32
Regular
"Pouch Ape"
Posts: 14,499
Turbonutter wrote:
> You've forgotton to change the hostname!

Good God, man, I do hope that was a joke! Please, have a bit more faith in me than that!
Sat 14/08/04 at 01:29
Regular
"Eff, you see, kay?"
Posts: 14,156
monkey_man wrote:
> >
> $new_file_name = "filename.jpg";
>
> $file_a = "$form_image_a";
> $remote_file = "$new_file_name";
> $ftp_host = "hostname";
> $conn_id = ftp_connect($ftp_host);
>
> $ftp_user_name = "username";
> $ftp_user_pass = "password";
>
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))
> { print("Successfully uploaded $file_a \n"); }
> else
> { print("There was a problem while uploading $file_a \n");
> }
>
> ftp_close($conn_id);
>
> ?>



I have your problem!

> $ftp_host = "hostname";

You've forgotton to change the hostname!
Sat 14/08/04 at 01:23
Regular
Posts: 2,849
Woah , i regret looking at this now.
Sat 14/08/04 at 01:22
Regular
"Pouch Ape"
Posts: 14,499
Cheers for your help, haven't got round to trying the "Connect or die, commie!!!" thing yet. Tomorrow, too late now.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con
LOVE it....
You have made it so easy to build & host a website!!!
Gemma

View More Reviews

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

Go to Support Centre
Feedback Close Feedback

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.