PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Muharrem ERIN   KG Uploader Class   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Uploader Class Test File
Class: KG Uploader Class
Manage multiple files uploaded with Web forms
Author: By
Last change:
Date: 16 years ago
Size: 2,498 bytes


Class file image Download
("Content-Type: text/html; charset=utf-8");
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<title>KG Uploader v1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
    body {
        margin:20px; background:#f2f2f2; font:0.8em/1.8em arial, helvetica, sans serif; color:#333;
    form {
    #reports {
        margin:auto; width:300px; padding:3px; background:#fff; border:1px solid #e0e0e0;
    #reports ul {
    #reports ul li {
        border-bottom:1px dotted #e0e0e0;
    #form {
        margin:auto; width:300px; padding:3px; margin-top:3px; background:#fff; border:1px solid #e0e0e0;

if($_FILES) {
<div id="reports">
= array('image/pjpeg', 'image/jpeg', 'image/gif', 'image/png', 'image/x-png', 'application/x-tar', 'application/zip', 'application/msword', 'application/', 'application/', 'application/mspowerpoint', 'application/x-shockwave-flash', 'text/plain', 'text/richtext', 'application/pdf'); // izin verilecek olan dosya tipleri
$kgUploaderOBJ = & new kg_uploader();
$kgUploaderOBJ -> uploader_set($_FILES['dosyalar'], './repo', $mime_types); // 1. parametre FILES dizisi, 2. parametre dizin, 3. parametre ise izin verilen dosya tipleri
$kgUploaderOBJ -> result_report(); // yukleme ayrintilarini gosterir
    /* //Eğer dosya isimleri bir tabloya kaydedilmek istenirse asagidaki gibi listeletilebilir.
    for ($i = 0; $i < count($kgUploaderOBJ -> uploaded_files); $i++) {
        echo $kgUploaderOBJ -> uploaded_files[$i];

<div id="form">
    <form method="post" action="test.php" enctype="multipart/form-data">
        <p><input type="file" name="dosyalar[]" id="dosya1" /></p>
        <p><input type="file" name="dosyalar[]" id="dosya2" /></p>
        <p><input type="file" name="dosyalar[]" id="dosya3" /></p>
        <p><input type="file" name="dosyalar[]" id="dosya4" /></p>
        <p><input type="file" name="dosyalar[]" id="dosya5" /></p>
        <p><input type="submit" name="upload" value="Yükle" id="upload" /></p>