开发者

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%20Vide‌​o%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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜