if (Isset ($method) && isset ($InputDir) && strcmp ($method, "UploadFile") ==0) {//uploading or deleting files
if (Is_file ($InputDir.) /". $_files[uploadfile][name])" {
chmod ($InputDir. " /". $_files[uploadfile][name],0777);
echo "File exists! Deleted!--You can upload file again ";
Unlink ($InputDir. " /". $_files[uploadfile][name]);
}else{
if (@copy ($_files[uploadfile][tmp_name), $InputDir. " /". $_files[uploadfile][name])" {
echo "file {$_files[uploadfile][name]} is correctly copied to {$InputDir} ...!";
}else{
echo "File copy failed ...!";
}
chmod ($InputDir. " /". $_files[uploadfile][name],0777);
}
}
if (Isset ($Info) && strcmp ($method, Drop) ==0) {//delete file or directory
if (Is_dir ($Info)) {
if (RmDir ($Info)) {
echo "Directory {$Inof} delete complete";
}else{
The echo directory cannot be deleted! Cause--maybe there are files in the directory! ";
}
}
if (Is_file ($Info)) {
if (unlink ($Info)) {
echo "File {$Info} deleted ...!"
}else{
Echo ' file {$Info} deletion failed ...! Attempt to modify file permissions delete ... ";
if (chmod ($Info, 0777)) {
Unlink ($Info);
echo "File {$Info} permissions modified after deletion ...";
}else{
The echo file {$Info} cannot be deleted by the Web, possibly with FTP permissions set on this file ... ";
}
}
}
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.