第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

rename()對文件夾操作引發(fā)了SFTP出問題,

跟King老師一步步做,學到了很多東西,但我對linux是菜鳥,不知是哪里出問題了,百度了兩天了,也沒能查了問題。

rename()刪除或重命名文件夾,點擊后,ubuntu要反應(yīng)很長時間,才能響應(yīng),操作的確成功了,但我的Sftp隨之也壞掉不能上傳文件了,上傳操作只上傳個文件名,零字節(jié),報unknow error

求King老師指點!?。?/p>

<?php
require_once?'inc/common.func.php';
$act=$_REQUEST['act'];
$dst=$_REQUEST['dst'];
$ori=$_REQUEST['ori'];
$path='file';
$path=$_REQUEST['path']?$_REQUEST['path']:$path;
$redirect="?path={$path}";

//$filename=$_REQUEST['filename'];
//$newname=$_REQUEST['newname'];
//$dirname=$_REQUEST['dirname'];?

$back=($path=="file")?"file":dirname($path);
$info=readDirectory($path);
//print_r($info);
//if(!$info){
//	echo?"<Script>alert('沒有文件或目錄');location.href='?'<//script>"	;
//};

if($act=='createFile'){//創(chuàng)建文件
	$mes=createFile($path."/".$dst);
	alertMes($mes,$redirect);
	
}elseif($act=='editContent'){//修改文件?內(nèi)容的操作
	$mes=editContent($path.'/'.$ori,$dst);
	alertMes($mes,$redirect);

}elseif($act=="renameFile"){//實現(xiàn)重命名操作
//echo?$ori.'-----'.$dst;
	$mes=renameFile($ori,$dst);
	alertMes($mes,$redirect);
	
}elseif($act=="delFile"){//刪除文件?
	$mes=delfile($ori);
	alertMes($mes,$redirect);

}elseif($act=="downFile"){//下載文件?
	$mes=downFile($filename);
//	alertMes($mes,$redirect);	

}elseif($act=="createFolder"){//創(chuàng)建文件夾
//	echo?$path."----".$dirname;
	$mes=createFolder($path,$dst);
	alertMes($mes,$redirect);

}elseif($act=="renameFolder"){
//	echo?$newname,"----",$dirname,"------",$path;
	$mes=renameFolder($ori,$path.'/'.$dst);
	alertMes($mes,$redirect);


}elseif($act=="copyFolder"){
//	echo?$ori,'----',$path."/".$dst."/".basename($ori);
	$mes=copyFolder($ori,$path."/".$dst."/".basename($ori));
	alertMes($mes,$redirect);
	
}elseif($act=="cutFolder"){
//	echo?$ori,'----',$path."/".$dst."/".basename($ori);
	$mes=cutFolder($ori,$path."/".$dst."/".basename($ori));
	alertMes($mes,$redirect);

}elseif($act=="copyFile"){
	$mes=copyFile($ori,$path."/".$dst."/".basename($ori));
	alertMes($mes,$redirect);

}elseif($act=="cutFile"){
	$mes=cutFile($ori,$path."/".$dst."/".basename($ori));
	alertMes($mes,$redirect);	

}elseif($act=="delFolder"){
//	echo?$ori;
	$mes=delFolder($ori);
	alertMes($mes,$redirect);	
	
}elseif($act=="uploadFile"){
//	print_r($_FILES);
	$fileInfo=$_FILES['dst'];
	$mes=uploadFile($fileInfo,$path);
	alertMes($mes,$redirect);
}
?>


<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
<title>filelist</title>
<link?rel="stylesheet"?href="inc/jquery-ui.css"?/>
<style?type="text/css">
body,p,div,ul,ol,table{	magin:0;	padding:0;	}
#fitop?span,.Opt?span{cursor:pointer}
.TTh?td{background-color:#ABCDEF;border-bottom:1px?#000000?solid;}
.BBh?td{border-bottom:1px?#000000?dotted;}

</style>

</head>
<!--
<script?src="inc/jquery-1.11.1.min.js"></script>
<script?src="inc/jquery-ui.js"></script>
-->
<script?src="inc/jquery-1.10.2.js"></script>
<script?src="inc/jquery-ui.js"></script>
<script?type="text/javascript">
$(document).ready(function(){
	$("#EditSaveBut").click(function(){
//		alert?("ddd")
	})
})

function?show(act,ori){
	var?bstr="";
	switch(act){
		case?"createFolder":
		var?bstr="輸入文件夾名稱:";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?/>";
		var?bstr=?bstr?+"<input?type='submit'?value='創(chuàng)建文件夾'?/>";
		break;

		case?"createFile":
		var?bstr="輸入新建文件名稱:";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?/>";
		var?bstr=?bstr?+"<input?type='submit'?value='新建文件'?/>";
		break;
		
		case?"uploadFile":
		var?bstr="選擇要上傳的文件:";
		var?bstr=?bstr?+"<input?type='file'?name='dst'?/>";
		var?bstr=?bstr?+"<input?type='submit'?value='上傳文件'?/>";
		$("#myform").attr("enctype","multipart/form-data");	
		break;
		
		case?"renameFolder":
		var?bstr="請?zhí)顚懶挛募A名稱:";
		var?bstr=?bstr?+"<input?type='hidden'?name='ori'?value='"+ori+"'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='重命名文件夾'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='重命名文件夾'?/>";		
		break;

		case?"renameFile":
		var?bstr="請?zhí)顚懶挛募Q:";
		var?bstr=?bstr?+"<input?type='hidden'?name='ori'?value='"+ori+"'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='無需后綴名'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='重命名文件'?/>";		
		break;

		case?"copyFolder":
		var?bstr="將文件夾復制到:";
		var?bstr=?bstr?+"<input?type='hidden'?value='"+ori+"'?name='ori'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='目的文件夾'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='復制文件夾'?/>";		
		break;

		case?"copyFile":
		var?bstr="將文件復制到:";
		var?bstr=?bstr?+"<input?type='hidden'?value='"+ori+"'?name='ori'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='目的文件夾必須存在'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='復制文件'?/>";		
		break;

		case?"cutFolder":
		var?bstr="將文件夾剪切到:";
		var?bstr=?bstr?+"<input?type='text'?value='"+ori+"'?name='ori'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='目的文件夾自動創(chuàng)建'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='剪切文件夾'?/>";		
		break;
		
		case?"cutFile":
		var?bstr="將文件剪切到:";
		var?bstr=?bstr?+"<input?type='hidden'?value='"+ori+"'?name='ori'?/>";
		var?bstr=?bstr?+"<input?type='text'?name='dst'?placeholder='目的文件夾'/>";
		var?bstr=?bstr?+"<input?type='submit'?value='剪切文件'?/>";		
		break;
		
		case?"delFolder":
		if(window.confirm("確定刪除文件夾?否則取消")){
			location.href="?act=delFolder&ori="+ori;
		};
		break;		
		
		case?"delFile":
		if(window.confirm("確定刪除文件?否則取消")){
			location.href="?act=delFile&ori="+ori;
		};
		break;			
		
	};
	$("#act").val(act);
	$("#bstr").html(bstr);
};
function?delFile(filename){
	var?path=$("#path").val();
//	alert(path+"----"+filename);
	if(window.confirm("確定刪除?否則取消")){
		location.href="?act=delFile&ori="+filename;
	}
}
function?showDetail(w,t,f){
	var?con="";
	if(w=='View'){
		con="<img?src='"+f+"'>";
		$("#DetailShow").html(con);
	};
	if(w=='Edit'){
		var?path=$("#path").val();
		$.post("ajax.php",{"act":"getcon","fileGet":f},function(data,status){
			con?=?con?+?"<form?action='?'?method='post'>";
			con?=?con?+?"<input?type='hidden'?name='act'?value='editContent'>";
			con?=?con?+?"<input?type='hidden'?value='"+t+"'?name='ori'?/><br>";
			con?=?con?+?"<input?type='hidden'?value='"+path+"'?name='path'>"
			con?=?con?+?"<textarea?name='dst'?cols='60'?rows='10'>"+data+"</textarea><br>";
			con?=?con?+?"<input?type='submit'?value='修改文件'?/>";
			con?=?con?+?"</form>";
			$("#DetailShow").html(con);
		});
	};
	$("#DetailShow").dialog({
		height:"auto",
		width:"auto",
		postition:{my:"center",at:"center",collision:"fit"},
		modal:false,
		draggable:true,
		resizable:true,
		title:w+":"+t,
		show:"slide",
		hide:"explode"
	})
}

function?goBack($back){
	location.href='?path='+$back;
}
</script>
<body>

<h1>在線文件管理器</h1>
<div?id="fitop">
【當前目錄:<?php?echo?$path;?>】
【<span?onclick="show('createFile');">新建文件</span>】
【<span?onclick="show('createFolder');">新建文件夾</span>】
【<span?onclick="show('uploadFile');">上傳文件</span>】
【<span?onclick="goBack('<?php?echo?$back;?>');">返回上層目錄</span>】
<form?action="?"?method="post"?id="myform"?style="float:right">
<input?type="hidden"?id="act"?name="act"?value=""?/>
<input?type="hidden"?id="path"?name="path"?value="<?php?echo?$path;?>"?/>
<span?id="bstr"></span>
</form>
</div>

<div?id="DetailShow"?style="display:none"></div>

<table?width="100%"?border="0"?cellpadding="5"?cellspacing="0">
<tr?bgcolor="ABCDEF"?class="TTh">
<td>編號</td><td>名稱</td><td>類型</td><td>大小</td><td>可讀</td><td>可寫</td><td>可執(zhí)行</td><td>創(chuàng)建時間</td><td>修改時間</td><td>訪問時間</td><td>操作</td>
</tr>
<!--讀取目錄的操作-->
<?php
if($info['dir']){
	$i=1;
	foreach($info['dir']?as?$val){
	$p=$path."/".$val;	
?>	
<tr?class='BBh'>
	<td><?php?echo?$i;?></td>
????<td><a?href="?path=<?php?echo?$p;?>"><?php?echo?$val;?></a></td>
????<td><?php?echo?filetype($p)=="file"?"文件":"目錄";?></td>
	<td><?php?$sum=0;echo?transByte(dirSize($p));?></td>
????<td><?php?echo?is_readable($p)?"可讀":"不可";?></td>
????<td><?php?echo?is_writable($p)?"可寫":"不可";?></td>
????<td><?php?echo?is_executable($p)?"可執(zhí)行":"不可";?></td>
????<td><?php?echo?date("Y-m-d",filectime($p));?></td>
????<td><?php?echo?date("Y-m-d",filemtime($p));?></td>
????<td><?php?echo?date("Y-m-d",fileatime($p));?></td>
????<td?class="Opt">
<!--?文件夾在rename()操作時有問題?-->
【<a?href="?path=<?php?echo?$p;?>">進入</a>】
【<span?onclick="show('renameFolder','<?php?echo?$p;?>');">重命名</span>】
【<span?onclick="show('copyFolder','<?php?echo?$p;?>');">復制到</span>】
【<span?onclick="show('cutFolder','<?php?echo?$p;?>');">剪切到</span>】
【<span?onclick="show('delFolder','<?php?echo?$p;?>');">刪除</span>】
???</td>
</tr>
<?php	$i++;	}}?>
<!--讀取文件操作-->
<?php
if($info['file']){
	(!$i)?$i=1:$i++;
	foreach($info['file']?as?$val){
	$p=$path."/".$val;	
?>	
<tr?class='BBh'>
	<td><?php?echo?$i;?></td>
????<td><?php?echo?$val;?></td>
????<td><?php?echo?filetype($p)=="file"?"文件":"目錄";?></td>
????<td><?php?echo?transByte(filesize($p));?></td>
????<td><?php?echo?is_readable($p)?"可讀":"不可";?></td>
????<td><?php?echo?is_writable($p)?"可寫":"不可";?></td>
????<td><?php?echo?is_executable($p)?"可執(zhí)行":"不可";?></td>
????<td><?php?echo?date("Y-m-d",filectime($p));?></td>
????<td><?php?echo?date("Y-m-d",filemtime($p));?></td>
????<td><?php?echo?date("Y-m-d",fileatime($p));?></td>
????<td?class="Opt">
【<a?href="?act=downFile&path=<?php?echo?$path;?>&filename=<?php?echo?$p;?>">下載</a>】
【<span?onclick="show('renameFile','<?php?echo?$p;?>');">重命名</span>】
【<span?onclick="show('copyFile','<?php?echo?$p;?>');">復制到</span>】
【<span?onclick="show('cutFile','<?php?echo?$p;?>');">剪切到</span>】
【<span?onclick="show('delFile','<?php?echo?$p;?>');">刪除</span>】
<?php?$ext=strtolower(end(explode(".",$val)));
	$imageExt=array("gif","jpg","jpeg","png");
	if(in_array($ext,$imageExt)){
?>
【<span?onclick="showDetail('View','<?php?echo?$val;?>','<?php?echo?$p;?>');">瀏覽</span>】
<?php	}else{?>
【<span?onclick="showDetail('Edit','<?php?echo?$val;?>','<?php?echo?$p;?>');">編輯</span>】
<?php?}?>?

</td>
</tr>
<?php	$i++;}}?>

</table>
</body>
</html>





正在回答

1 回答

King老師呢

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

rename()對文件夾操作引發(fā)了SFTP出問題,

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號