connect ftp account with file_get_content function
I have an FTP account. I want to connect to FTP 开发者_运维技巧with file_get_contents. Is this possible? If not, how can I do it?
I want to do this for an upload script similar to hotfile or rapidshare.
file_get_contents('ftp://username:password@host.com/');
If I understand what you want to do from your comments on @genesis' answer, what you need to do is this:
$file = file_get_contents("derpost:pass**@ftp1.freakshare.com/Freez%20Screen%20Video%20Capture.lnk");
header('Content-Disposition: attachment; filename="image.jpg"'); // Change file name as appropriate
header('Content-Length: '.strlen($file));
header('Content-Type: image/jpeg'); // Change this MIME type as appropriate
echo $file;
精彩评论