mannhullet / mannhullet_no

The webpage of the student association Mannhullet at NTNU
https://www.mannhullet.no
0 stars 0 forks source link

Serve archive files using php, instead of direct link #31

Open andrebk opened 6 years ago

andrebk commented 6 years ago

Currently the archive provides a direct link to the file, which is then opened in the same tab. This means that the title of the tab is the very ugly UUID of the file. Instead the request should be handled by the back-end, allowing it to set the element. </p> <p>See <a rel="noreferrer nofollow" target="_blank" href="https://serverfault.com/questions/316814/php-serve-a-file-for-download-without-providing-the-direct-link">https://serverfault.com/questions/316814/php-serve-a-file-for-download-without-providing-the-direct-link</a>, which also has a nice .htaccess trick that might be useful for #30. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/andrebk"><img src="https://avatars.githubusercontent.com/u/18532709?v=4" />andrebk</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>Optional stackexchange: <a href="https://stackoverflow.com/questions/20080341/correct-php-headers-for-pdf-file-download">https://stackoverflow.com/questions/20080341/correct-php-headers-for-pdf-file-download</a></p> <p>Apparantly, readfile() has poor performance, as the entire file is buffered in RAM on the server before being sent (?)</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/andrebk"><img src="https://avatars.githubusercontent.com/u/18532709?v=4" />andrebk</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>Something similar is already done in <code>application/models/DbTable/Files.php->downloadFile($fid)</code></p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>