V
V
Viva88882021-12-29 20:54:02
PHP
Viva8888, 2021-12-29 20:54:02

Why does an Internal Server Error occur when uploading a pdf file to a site?

Hello! There was a following problem. When loading some files with pdf extensions, an
Internal Server Error appears. Some files load well and some don't. I will attach the processing code.

$config['upload_path']          = './assets/books/';
        $config['allowed_types']        = '*';
        $config['max_size']             = 0;
        $config['max_width']            = 0;
        $config['max_height']           = 0;
        $config['min_width']             = 0;
        $config['min_height']            = 0;
        $config['max_filename']           = 0;
        



        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload('book'))
        {
            echo "Не получалось загрузить книгу";
            die(); 
        }
        else
        {
            $data = array('upload_data' => $this->upload->data());
            $up['book_url'] = $data['upload_data']['file_name'];
            // print($up['book_url']);
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2021-12-29
@FanatPHP

5zf667.jpg
Errors are usually written to the web server's error log, unless otherwise specified in the PHP settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question