dimanche 6 octobre 2019

Large upload image file size

I have increment the file size. But still doesn't work, I would like to add any of these codes and increase the size of the file if it is accessible...

MySQL 5, PHP 5

        $permited  = array('jpg', 'jpeg', 'png', 'gif');
        $file_name = $_FILES['image']['name'];
        $file_size = $_FILES['image']['size'];
        $file_temp = $_FILES['image']['tmp_name'];

        $div = explode('.', $file_name);
        $file_ext = strtolower(end($div));
        $unique_image = substr(md5(time()), 0, 10) . '.' . $file_ext;
        $uploaded_image = "upload/" . $unique_image;


        if ($title == "" || $cat == "" || $body == "" || $tags == "") {
            echo "<span class='error'> Must be Fill</span>";
        } else {
            if (!empty($file_name)) {
                if ($file_size > 50048567) {


                    echo "<span class='error'>Image Size should be less then 1MB!
            </span>";
                } elseif (in_array($file_ext, $permited) === false) {
                    echo "<span class='error'>You can upload only:-"
                        . implode(', ', $permited) . "</span>";
                } else {
                    move_uploaded_file($file_temp, $uploaded_image);
                    $query = "UPDATE  tbl_post
                SET



Aucun commentaire:

Enregistrer un commentaire