我希望能够通过phpbb将远程文件上传到我的服务器,而无需先将文件下载到我的PC。这怎么能实现?phpBB远程文件上传
我有一些简单的代码,我已经测试,它做的工作,但我可以把它放在哪里,我需要在phpBB中修改什么?
<form method="post">
<input name="url" size="50"/>
<input name="submit" type="submit"/>
</form>
<?php
// maximum execution time in seconds
set_time_limit(24 * 60 * 60);
if (!isset($_POST['submit'])) die();
// folder to save downloaded files to. must end with slash
$destination_folder = 'mydownloads/';
$url = $_POST['url'];
$newfname = $destination_folder . basename($url);
//Open remote file
$file = fopen($url, "rb");
if ($file) {
//Write to local file
$newf = fopen($newfname, "wb");
if ($newf) {
while (!feof($file)) {
fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
}
}
}
if ($file) {
fclose($file);
}
if ($newf) {
fclose($newf);
}
?>
或者是有可能打入远程化身功能中的phpBB(即包括/ functions_upload.php - >功能remote_upload($ UPLOAD_URL))? 我当然需要通过通常的phpBB函数发送远程文件,将其插入到数据库和所有数据库中。
? – Abadis 2013-05-19 07:23:27
最新版本 - 3.0.11 – 2013-05-19 11:24:29
创建** includes/functions_upload.php **的备份,然后打开原件,在必要时放置代码,然后按照PHPBB上传文件的过程(插入到db,检查恶意文件)并试用。 – 2013-05-19 22:22:27