daniel1983 LiteCart Fan Fra Netherlands Medlem siden daniel1983 9 mars 2023 00:54 I would like to upload a PDF catalog and add it to a product. However, this file is about 80MB in size, but it won't work. I have now also tried smaller files (7-20mb), but that doesn't work either. Yes, small files of about 1 MB are no problem. But I have other large files of even more than 100 MB that I would like to link.
tim Founder Fra Sweden Medlem siden tim 9 mars 2023 07:30 Change your php.ini settings https://stackoverflow.com/questions/2184513/change-the-maximum-upload-file-size
daniel1983 LiteCart Fan Fra Netherlands Medlem siden daniel1983 9 mars 2023 13:38 Thank you for your response, I finally managed to adjust it in the backend of my hosting server. Now I have another question, is it perhaps also possible to change the line so that the document is opened immediately instead of downloaded? Because files of 100mb are quite large. foreach (array_keys($files) as $key) { echo '<li>'. functions::draw_fonticon('fa-paperclip') .' <a href="'. document::ilink('get_file', array('product_id' => $product_id, 'file_id' => $files[$key]['id'])) .'" target="_blank">'. $files[$key]['filename'] .'</a></li>' . PHP_EOL; } ?>```
tim Founder Fra Sweden Medlem siden tim 9 mars 2023 18:46 To make files open rather than save change the header in get_file.inc.php: header('Content-type: application/octet-stream'); To the right content type like header('Content-Type: application/pdf'); Or if the mime types are in the database: header('Content-Type: ' . $file['mime']); Also change header('Content-Disposition: attachment; filename="' . $file['filename'] .'"'); To header('Content-Disposition: inline; filename="' . $file['filename'] .'"');
daniel1983 LiteCart Fan Fra Netherlands Medlem siden daniel1983 10 mars 2023 01:28 Thank you very much for this comment, I am very happy about this. This is really an improvement for my site, I would never have come up with this myself.