我希望能夠通過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