Tag: file

  • File type validation with Javascript

    前些時候寫的簡單版測試程式,在表單送出前用 JavaScript 檢查檔案副檔名。當然這只是第一步驗證,在 PHP 端還是要對 Content Type 做一次檢查。 <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>File Type Validation in JavaScript. ver 0.1</title> </head> <body> <form method=”post” enctype=”multipart/form-data” onsubmit=”return checkAllFile();”;> <input class=”file-selector” type=”file” name=”userfile1″ size=”20″/></br> <input class=”file-selector” type=”file” name=”userfile2″ size=”20″/></br> <input class=”file-selector” type=”file” name=”userfile3″ size=”20″/></br> <input class=”file-selector” type=”file” name=”userfile4″ size=”20″/></br> <input class=”file-selector” type=”file” name=”userfile5″ size=”20″/></br> <input…

  • Windows Vista / 7 檔案複製、移動、同步指令:robocopy

    最近在整理外接硬碟的檔案,想把整顆 500GB 硬碟的資料複製到另一顆新硬碟,想起以前看過 Windows 7 有個內建指令可以加速這個工作:robocopy。 這指令名字很好記,跟【機器戰警】RoboCop 只差了一個字 XD。實際上這個指令從 Windows Vista 就開始內建了,其他 Windows 作業系統則要另外安裝微軟提供的套件才有。