コード例 #1
0
                     if (!$ie) {
                         echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $form . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n";
                     }
                 } else {
                     db_dropdown('pixie_files', "", $form, "file_id >= '0' order by file_id desc");
                     if (!$ie) {
                         echo "\n\t\t\t\t\t\t\t\t<span class=\"more_upload\">or <a href=\"#\" onclick=\"upswitch('" . $form . "'); return false;\" title=\"" . $lang['upload'] . "\">" . strtolower($lang['upload']) . "...</a></span>\n\t\t\t\t\t\t\t\t</div>\n";
                     }
                 }
             }
         }
     }
     die;
 }
 $max_size = 1024 * 100;
 $multi_upload = new muli_files();
 $file_name = $_FILES['upload']['name'][0];
 $file_ext = substr(strrchr($file_name, '.'), 1);
 $file_ext = strtolower($file_ext);
 if ($file_ext == 'jpg' or $file_ext == 'gif' or $file_ext == 'png') {
     $dir = '../../../files/images/';
     $file_type = 'Image';
 } else {
     if ($file_ext == 'mov' or $file_ext == 'flv' or $file_ext == 'avi' or $file_ext == 'm4v' or $file_ext == 'mp4' or $file_ext == 'mkv' or $file_ext == 'ogv') {
         $dir = '../../../files/video/';
         $file_type = 'Video';
     } else {
         if ($file_ext == 'mp3' or $file_ext == 'flac' or $file_ext == 'ogg' or $file_ext == 'wav' or $file_ext == 'pls' or $file_ext == 'm4a' or $file_ext == 'xspf') {
             $dir = '../../../files/audio/';
             $file_type = 'Audio';
         } else {
コード例 #2
0
                    }
                }
            }
            if ($this->bad_filenames > 0) {
                $this->message[] = $this->extra_text(5);
            }
            if ($this->wrong_extensions > 0) {
                $this->show_extensions();
                $this->message[] = $this->extra_text(2);
            }
        } else {
            $this->message[] = $this->extra_text(3);
        }
    }
}
$multi_upload = new muli_files();
$multi_upload->upload_dir = $_SERVER['DOCUMENT_ROOT'] . "/files/";
// "files" is the folder for the uploaded files (you have to create this folder)
$multi_upload->extensions = array(".png", ".zip");
// specify the allowed extensions here
$multi_upload->message[] = $multi_upload->extra_text(4);
// a different standard message for multiple files
//$multi_upload->rename_file = true; // set to "true" if you want to rename all files with a timestamp value
$multi_upload->do_filename_check = "y";
// check filename ...
if (isset($_POST['Submit'])) {
    $multi_upload->tmp_names_array = $_FILES['upload']['tmp_name'];
    $multi_upload->names_array = $_FILES['upload']['name'];
    $multi_upload->error_array = $_FILES['upload']['error'];
    $multi_upload->replace = isset($_POST['replace']) ? $_POST['replace'] : "n";
    // because only a checked checkboxes is true
コード例 #3
0
ファイル: test.php プロジェクト: gauravsaxena21/simantz
<?php

include "../class/upload_class.php";
include_once "../class/Simit_File.inc.php";
error_reporting(E_ALL);
$max_size = 1024 * 1024;
// the max. size for uploading (~1MB)
define("MAX_SIZE", $max_size);
$foto_upload = new muli_files();
$foto_upload->upload_dir = "new/";
// "files" is the folder for the uploaded files (you have to create these folder)
$foto_upload->foto_folder = "new/photo/";
$foto_upload->thumb_folder = "new/thumb/";
$foto_upload->extensions = array(".jpg", ".png");
// specify the allowed extension(s) here
$foto_upload->language = "en";
$foto_upload->x_max_size = 300;
$foto_upload->y_max_size = 200;
$foto_upload->x_max_thumb_size = 120;
$foto_upload->y_max_thumb_size = 150;
if (isset($_POST['Submit']) && $_POST['Submit'] == "Upload") {
    $foto_upload->the_temp_file = $_FILES['upload']['tmp_name'];
    $foto_upload->the_file = $_FILES['upload']['name'];
    $foto_upload->http_error = $_FILES['upload']['error'];
    $foto_upload->replace = isset($_POST['replace']) ? $_POST['replace'] : "n";
    // because only a checked checkboxes is true
    $foto_upload->do_filename_check = "n";
    if ($foto_upload->upload()) {
        $foto_upload->process_image(false, true, 80);
        $foto_upload->message[] = "Processed foto: " . $foto_upload->file_copy . "!";
        // "file_copy is the name of the foto"