10 days Learn PHP Day 10
-
$f = $HTTP_ POST_ FILES [ 'file' ]; -
-
$dest_ dir = 'uploads' ; //Set upload directory -
-
$dest = $dest_ dir . '/' . date ( "ymd" ). "_" . $f [ 'name' ]; //I set the file name as date and file name to avoid repetition -
-
$r =move_ uploaded_ file( $f [ 'tmp_ name' ], $dest ); -
-
chmod ( $dest , 0755); //Set the properties of the uploaded file
Related articles
Intelligent floating layer positioning solution The difference between javascript execution before and after elements Js implements the deletion confirmation dialog box 9 common mistakes in CSS layout Firebug Debugging PHP Closed Label Blank Line Solution JQuery implements the effect of mouse sliding delay display