Jump to content

ftp write file


dazzer12345

Recommended Posts

Hello,

Im trying to write to a file on an ftp server.

I can login ok.

I can write to the temp file

I can send the temp file to the server ok.it shows up.

but the text i wrote to the file 'test' is not there. its an empty fileany ideas.also i have used fopen but

i could not get that to work on my particular ftp server (but did when calling the script form localhost)

so im trying this way as a work around.

 

$ftpstream = @ftp_connect($filetodomain);

$login = @ftp_login($ftpstream, $filetouser,$filetopassword);

$temp = tmpfile();

fwrite ($temp, "test");

fputs($temp,'test');

@ftp_fput($ftpstream, "//temp//"."cool10.txt" , $temp, FTP_ASCII);

fclose($temp);

ftp_close($ftpstream);

 

 

 

thanku

Link to comment
https://forums.phpfreaks.com/topic/181331-ftp-write-file/
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.