ZIPwebUploader Demo源码下载 254.39KB

wx11408115

资源文件列表:

uploadDemo.zip 大约有26个文件
  1. uploadDemo/
  2. uploadDemo/Uploader.swf 139.75KB
  3. uploadDemo/WiFi_Uncle/
  4. uploadDemo/WiFi_Uncle_tmp/
  5. uploadDemo/css/
  6. uploadDemo/css/style.css 8.73KB
  7. uploadDemo/css/webuploader.css 515B
  8. uploadDemo/expressInstall.swf 756B
  9. uploadDemo/favicon.ico 1.39KB
  10. uploadDemo/images/
  11. uploadDemo/images/ajax-loader.gif 1.53KB
  12. uploadDemo/images/bg.png 2.78KB
  13. uploadDemo/images/icons.png 2.62KB
  14. uploadDemo/images/image.png 1.63KB
  15. uploadDemo/images/progress.png 1.24KB
  16. uploadDemo/images/success.png 1.58KB
  17. uploadDemo/js/
  18. uploadDemo/js/jquery.js 90.42KB
  19. uploadDemo/js/upload.js 19.5KB
  20. uploadDemo/js/webuploader.js 273.62KB
  21. uploadDemo/server/
  22. uploadDemo/server/crossdomain.xml 100B
  23. uploadDemo/server/fileupload.php 4.91KB
  24. uploadDemo/server/preview.php 1.79KB
  25. uploadDemo/upload/
  26. uploadDemo/upload/index.html 1.39KB

资源介绍:

web Uploader demo (有修改) 百度云及我遇到的问题汇总: https://blog.csdn.net/wx11408115/article/details/70215714
<?php /** * upload.php * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ #!! 注意 #!! 此文件只是个示例,不要用于真正的产品之中。 #!! 不保证代码安全性。 #!! IMPORTANT: #!! this file is just an example, it doesn't incorporate any security checks and #!! is not recommended to be used in production environment as it is. Be sure to #!! revise it and customize to your needs. // Make sure file is not cached (as it happens for example on iOS devices) header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // Support CORS // header("Access-Control-Allow-Origin: *"); // other CORS headers if any... if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { exit; // finish preflight CORS requests here } if ( !empty($_REQUEST[ 'debug' ]) ) { $random = rand(0, intval($_REQUEST[ 'debug' ]) ); if ( $random === 0 ) { header("HTTP/1.0 500 Internal Server Error"); exit; } } // header("HTTP/1.0 500 Internal Server Error"); // exit; // 5 minutes execution time @set_time_limit(5 * 60); // Uncomment this one to fake upload time // usleep(5000); // Settings // $targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload"; $targetDir = '../WiFi_Uncle_tmp'; $uploadDir = '../WiFi_Uncle'; $cleanupTargetDir = true; // Remove old files $maxFileAge = 5 * 3600; // Temp file age in seconds // Create target dir if (!file_exists($targetDir)) { @mkdir($targetDir); } // Create target dir if (!file_exists($uploadDir)) { @mkdir($uploadDir); } @mkdir($uploadDir); // Get a file name if (isset($_REQUEST["name"])) { $fileName = $_REQUEST["name"]; } elseif (!empty($_FILES)) { $fileName = $_FILES["file"]["name"]; } else { $fileName = uniqid("file_"); } $filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName; $uploadPath = $uploadDir . DIRECTORY_SEPARATOR . $fileName; // Chunking might be enabled $chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; $chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 1; // Remove old temp files if ($cleanupTargetDir) { if (!is_dir($targetDir) || !$dir = opendir($targetDir)) { die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}'); } while (($file = readdir($dir)) !== false) { $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file; // If temp file is current file proceed to the next if ($tmpfilePath == "{$filePath}_{$chunk}.part" || $tmpfilePath == "{$filePath}_{$chunk}.parttmp") { continue; } // Remove temp file if it is older than the max age and is not the current file if (preg_match('/\.(part|parttmp)$/', $file) && (@filemtime($tmpfilePath) < time() - $maxFileAge)) { @unlink($tmpfilePath); } } closedir($dir); } // Open temp file if (!$out = @fopen("{$filePath}_{$chunk}.parttmp", "wb")) { die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } if (!empty($_FILES)) { if ($_FILES["file"]["error"] || !is_uploaded_file($_FILES["file"]["tmp_name"])) { die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}'); } // Read binary input stream and append it to temp file if (!$in = @fopen($_FILES["file"]["tmp_name"], "rb")) { die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}'); } } else { if (!$in = @fopen("php://input", "rb")) { die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}'); } } while ($buff = fread($in, 4096)) { fwrite($out, $buff); } @fclose($out); @fclose($in); rename("{$filePath}_{$chunk}.parttmp", "{$filePath}_{$chunk}.part"); $index = 0; $done = true; for( $index = 0; $index < $chunks; $index++ ) { if ( !file_exists("{$filePath}_{$index}.part") ) { $done = false; break; } } if ( $done ) { if (!$out = @fopen($uploadPath, "wb")) { die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } if ( flock($out, LOCK_EX) ) { for( $index = 0; $index < $chunks; $index++ ) { if (!$in = @fopen("{$filePath}_{$index}.part", "rb")) { break; } while ($buff = fread($in, 4096)) { fwrite($out, $buff); } @fclose($in); @unlink("{$filePath}_{$index}.part"); } flock($out, LOCK_UN); } @fclose($out); } die($_SESSION['fileName']);
100+评论
captcha
    类型标题大小时间
    ZIP软件开发常用图标12.44MB11年前
    ZIPspring-framework-2.1-m110.61MB17年前
    ZIP高仿qq最新安卓版头像裁剪1.25MB10年前
    ZIPExpandableListViewDemo438.9KB12年前
    ZIP世界地图shp文件格式 绘图使用982.2KB11年前
    ZIPPowerStrip v3.87 CRT显示器调整工具1.29MB14年前
    ZIPpython操作海康威视相机------例程由海康官方提供 感谢海康工作人员14.25MB5年前
    ZIPHttpWatcher5.92MB17年前