
02.04.2014, 18:43
|
|
Постоянный
Регистрация: 06.01.2012
Сообщений: 913
Провел на форуме: 193811
Репутация:
724
|
|
PHP код:
[COLOR="#000000"][COLOR="#0000BB"]$uploaded_filename[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]str_replace[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#DD0000"]" "[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#DD0000"]"_"[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]"dumpfile"[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]"name"[/COLOR][COLOR="#007700"]]);
[/COLOR][COLOR="#0000BB"]$uploaded_filename[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]preg_replace[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#DD0000"]"/[^_A-Za-z0-9-\.]/i"[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#DD0000"]''[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]$uploaded_filename[/COLOR][COLOR="#007700"]);
[/COLOR][COLOR="#0000BB"]$uploaded_filepath[/COLOR][COLOR="#007700"]=[/COLOR][COLOR="#0000BB"]str_replace[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#DD0000"]"\\"[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#DD0000"]"/"[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#0000BB"]$upload_dir[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#DD0000"]"/"[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]$uploaded_filename[/COLOR][COLOR="#007700"]);[/COLOR][/COLOR]
...
PHP код:
[COLOR="#000000"][COLOR="#0000BB"][/COLOR][COLOR="#007700"]else if (!@[/COLOR][COLOR="#0000BB"]move_uploaded_file[/COLOR][COLOR="#007700"]([/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]"dumpfile"[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]"tmp_name"[/COLOR][COLOR="#007700"]],[/COLOR][COLOR="#0000BB"]$uploaded_filepath[/COLOR][COLOR="#007700"]))
{ echo ([/COLOR][COLOR="#DD0000"]"Error moving uploaded file "[/COLOR][COLOR="#007700"].[/COLOR][COLOR="#0000BB"]$_FILES[/COLOR][COLOR="#007700"][[/COLOR][COLOR="#DD0000"]"dumpfile"[/COLOR][COLOR="#007700"]][[/COLOR][COLOR="#DD0000"]"tmp_name"[/COLOR][COLOR="#007700"]].[/COLOR][COLOR="#DD0000"]" to the[/COLOR][COLOR="#0000BB"]$uploaded_filepath[/COLOR][COLOR="#DD0000"]\n"[/COLOR][COLOR="#007700"]);
echo ([/COLOR][COLOR="#DD0000"]"Check the directory permissions for[/COLOR][COLOR="#0000BB"]$upload_dir[/COLOR][COLOR="#DD0000"](must be 777)!\n"[/COLOR][COLOR="#007700"]);
}[/COLOR][/COLOR]
|
|
|