Created
September 9, 2017 10:39
-
-
Save Sanix-Darker/292c5c7238ef05e1bd4b325d1ce75565 to your computer and use it in GitHub Desktop.
Simple upload file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$file=''; | |
if(isset($_FILES['img']) AND $_FILES["img"]['size']<=10000000 AND $_FILES["img"]['size']>100){ | |
$folder = '../images/blog/'; | |
$tmp_name = $_FILES["img"]["tmp_name"]; | |
$name = $_FILES["img"]["name"]; | |
$img = pathinfo($_FILES["img"]['name']); | |
$file = "blog_".rand(0,999999).$name; | |
move_uploaded_file($tmp_name, $folder.$file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment