:::

12-3 上課範例:jupload.php

<?php
include_once "header.php";
include_once XOOPS_ROOT_PATH."/modules/tadtools/jupload/jupload.php";
if(!$xoopsUser)  die('無上傳權限');

if($_GET['op']=='import'){
  if ($dh = opendir(XOOPS_ROOT_PATH."/uploads/contact/video")) {
    while (($file = readdir($dh)) !== false) {
      if(strlen($file)<=2)continue;
      $f=explode(".",$file);
      $ext=strtolower($f[1]);
      rename(XOOPS_ROOT_PATH."/uploads/contact/video/{$file}",XOOPS_ROOT_PATH."/uploads/contact/{$_GET['sn']}.{$ext}");
      die("請點擊「影片」以觀看之");
    }
  }
}else{
  $appletParameters = array(
    'maxFileSize' => '2G',
    'postURL' => XOOPS_URL.'/modules/contact/jupload.php',
    'archive' => XOOPS_URL.'/modules/tadtools/jupload/wjhk.jupload.jar',
    'afterUploadURL' => XOOPS_URL."/modules/contact/index.php?sn={$_GET['sn']}&op=import",
    'allowedFileExtensions' => 'flv/mp4',
    'sendMD5Sum' => 'true',
    'showLogWindow' => 'false',
    'debugLevel' => 99
  );
  $classParameters = array(
    'demo_mode' => false,
    'allow_subdirs' => true,
    'destdir' => XOOPS_ROOT_PATH."/uploads/contact/video"
  );
  $juploadPhpSupportClass = new JUpload($appletParameters, $classParameters);
  echo "<!--JUPLOAD_APPLET-->";
}
?>

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.cp22.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D792%26tbsn%3D26

書籍目錄

展開 | 闔起

線上使用者

582人線上 (126人在瀏覽線上書籍)

會員: 0

訪客: 582

更多…