⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 json_upload.php

📁 this is a simple upload files codes with jason(ajax) tech.
💻 PHP
字号:
<?php
			
		require_once "json/json.php";
		require_once "upload_class.php";
		        	  
		$json = new Services_JSON();
    	  
    $uploaded = $GLOBALS['HTTP_RAW_POST_DATA'];
    $uploaded = $json->decode($uploaded);
		
		$i = 1;
		if ($handle = opendir('upload/')) 
		{
    	while (false !== ($file = readdir($handle))) 
    	{ 
    		if (is_file("upload/$file")) 
    		{ 
    			  	if($i == 1)
    			  	{
    			  		$mainfile = "File(s) uploaded: <br>";
    			  	}
        			$mainfile .= ($i<10)? "0".$i : $i;
        			$mainfile .= ". <a href='upload/$file'>".$file."</a><br>";
        			$i++;
    		} 
    	}
    	
    	closedir($handle); 
		}
		else
		{
			$mainfile = "empty";
		}
		
		$uploaded->filesName = $mainfile;
		$uploaded = $json->encode($uploaded);

    echo $uploaded;
        
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -