Issue with uploading large pdf files

LiteCart Fan
Fra Netherlands
Medlem siden

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.

LiteCart Fan
Fra Netherlands
Medlem siden

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

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'] .'"');

LiteCart Fan
Fra Netherlands
Medlem siden

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.

Du
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.