* All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Names of its contributors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Asetukset $conf['filetypes'] = array("bmp","jpg","jpeg","png","swf","svg","txt"); $conf['max_filesize'] = 1024; // Max. tiedoston koko Kt. Eli 1024 = 1MB, 2048 = 2MB. $conf['kansio'] = "uploads/"; // Kansio minne kaikki laitetaan. $conf['fix_pahat_kirjaimet'] = true; // Muuttaa ääkköset aakkosiksi, poistaa ()[] jne. $conf['polku'] = ""; // Laitetaan alkuun joku osoite. Älä muuta jos et tiedä mitä olet tekemässä $conf['banned_ips'] = array("123.123.123.123","123.123.123.123"); // IP:t, jotka eivät voi lisätä tiedostoja. $conf['imagecheck'] = true; // Tarkistaa onko kyseessä oikeasti kuva, jos tiedostopääte on GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM tai WBMP. $conf['nayta_tiedostot'] = true; // Näyttää listauksen upatuista tiedostoista $conf['session'] = "upload"; // SESSION:in nimi. Ei tarvitse muuttaa, jos et tajua sitä. $conf['charset'] = "ISO-8859-15"; // Merkistö. Yleensä ISO-8859-15 // Itse scripta. Älä koske enää ;) // Onko CSS? if (isset($_GET['css'])) { header('Content-type: text/css; charset='.$conf['charset']); print ' body { font-size:12px; font-family:Verdana,Arial,sans-serif; } .fileupload, #fileupload_error { border:1px #8099B3 solid; margin:4px; padding:4px; width:60%; min-width: 350px; background-color:#F0F7FF; text-align:left; min-height:100px; } #fileupload_error { background-color:#F7DDDD; border:1px #841C1C solid; } .fileupload label { float:left; width:100px; text-align:right; padding-right:10px; } .fileupload input { float:left; width:200px; text-align:left; font-size:12px; font-family:Verdana,Arial,sans-serif; } #submit { margin-top:3px; border:1px #3D5A7C solid; background-color:#CBD5E0; margin-left:110px; width:auto!important; } #submit:hover { background-color:#B1C1D3; } h1 { margin:0px; padding:0px; color:#893939; border-bottom:1px #E13232 dotted; } #ilo { color:#426854; border-bottom:1px #2FB970 dotted; } .tieto { font-size:10px; color:#616161; margin-left:110px; } br { clear:left; } .tiedosto { width:50%; float:left; } '; exit; } session_start(); // Merkistö header('Content-type: text/html; charset='.$conf['charset']); // Tarvittavat functiot function humanread($bytes) { $pp = array("B","KB","MB","GB","TB"); $menossa = 0; while ($bytes >= 1024) { $menossa++; $bytes = $bytes / 1024; } return round($bytes,2).$pp[$menossa]; } function msgdie($msg,$error=false) { print('