$data=<<<EOD <h1>Data goes here...</h1> EOD; $connection='localhost'; ftp_login($connection, user, password); ftp_put($connection, somefile.html, $data, FTP_ASCII); PHP: This fails as it expects $data to be a resource.. How to store $data into a file with ftp?
Actually I wanted to write a file to the server when fopen() is not allowed. Now I found I can write it to a temporary file & use it as resource.. So problem solved..