
30.04.2012, 05:27
|
|
Новичок
Регистрация: 29.03.2010
Сообщений: 0
С нами:
8484226
Репутация:
0
|
|
я аплоадер заливаю сразу,а потом шел
PHP код:
[COLOR="#000000"]
Max's File Uploader
[COLOR="#0000BB"]setUploadLocation(getcwd().DIRECTORY_SEPARATOR);
[/COLOR][COLOR="#0000BB"]$myUpload[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]uploadFile[/COLOR][COLOR="#007700"]();
[/COLOR][COLOR="#0000BB"]?>
[/COLOR][COLOR="#0000BB"]uploadLocation[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]getcwd[/COLOR][COLOR="#007700"]().[/COLOR][COLOR="#0000BB"]DIRECTORY_SEPARATOR[/COLOR][COLOR="#007700"];
}
[/COLOR][COLOR="#FF8000"]/**
* This function sets the directory where to upload the file
* In case of Windows server use the form: c:\\temp\\
* In case of Unix server use the form: /tmp/
*
* @param String Directory where to store the files
*/
[/COLOR][COLOR="#007700"]function[/COLOR][COLOR="#0000BB"]setUploadLocation[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$dir[/COLOR][COLOR="#007700"]){
[/COLOR][COLOR="#0000BB"]$this[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]uploadLocation[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]$dir[/COLOR][COLOR="#007700"];
}
function[/COLOR][COLOR="#0000BB"]showUploadForm[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$msg[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"]){
[/COLOR][COLOR="#0000BB"]?>
[/COLOR]
File Uploader
[COLOR="#0000BB"]'[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]$msg[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"];
} else if ([/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]!=[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"]){
echo[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"];
}
[/COLOR][COLOR="#0000BB"]?>
[/COLOR]
File:
Powered by PHP F1 Modded by: ZaraByte
[COLOR="#0000BB"][/COLOR][COLOR="#0000BB"]showUploadForm[/COLOR][COLOR="#007700"]();
} else {
[/COLOR][COLOR="#0000BB"]$msg[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"];
[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"];
[/COLOR][COLOR="#FF8000"]//Check destination directory
[/COLOR][COLOR="#007700"]if (![/COLOR][COLOR="#0000BB"]file_exists[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$this[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]uploadLocation[/COLOR][COLOR="#007700"])){
[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]"The target directory doesn't exists!"[/COLOR][COLOR="#007700"];
} else if (![/COLOR][COLOR="#0000BB"]is_writeable[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$this[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]uploadLocation[/COLOR][COLOR="#007700"])) {
[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]"The target directory is not writeable!"[/COLOR][COLOR="#007700"];
} else {
[/COLOR][COLOR="#0000BB"]$target_path[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]$this[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]uploadLocation[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]basename[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]'myfile'[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]'name'[/COLOR][COLOR="#007700"]]);
if(@[/COLOR][COLOR="#0000BB"]move_uploaded_file[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]'myfile'[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]'tmp_name'[/COLOR][COLOR="#007700"]],[/COLOR][COLOR="#0000BB"]$target_path[/COLOR][COLOR="#007700"])) {
[/COLOR][COLOR="#0000BB"]$msg[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]basename[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]'myfile'[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]'name'[/COLOR][COLOR="#007700"]]).
[/COLOR][COLOR="#DD0000"]" was uploaded successfully!"[/COLOR][COLOR="#007700"];
} else{
[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#DD0000"]"The upload process failed!"[/COLOR][COLOR="#007700"];
}
}
[/COLOR][COLOR="#0000BB"]$this[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]showUploadForm[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$msg[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]$error[/COLOR][COLOR="#007700"]);
}
}
}
[/COLOR][COLOR="#0000BB"]?>
[/COLOR][/COLOR]
|
|
|