Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
關於 PHP 檔案上傳 檢查是否有重複!
Jul 11th 2013, 01:28

在網路上查到以下的原始碼 .... 
 
請問一下 要如何修改 才能檢查 上傳的檔案 是否檔名有重複呢?
 
$uploaddir = '';
$uploadfile = $uploaddir.basename($_FILES['myfile']['name']);

echo "<pre>";

if (move_uploaded_file($_FILES['myfile']['tmp_name'], iconv("utf-8", "big5", $uploadfile))) {
    echo "上傳完成 \n";
    echo "檔案名稱:" . $_FILES["myfile"]["name"] . "<BR>";
    echo "檔案大小:" . $_FILES["myfile"]["size"];
    echo " bytes" . "<BR>";
    echo "檔案類型:" . $_FILES["myfile"]["type"] . "<BR>";

} else {
    echo "上傳失敗 \n";
 
}

echo "</pre>";
?>
 

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    yuahong1 發表在 痞客邦 留言(0) 人氣()