Menu

#523 Feature request: Inline browsing of attachments instead of downloads

Unknown
open
None
6.7.0
Feature
8.2
Linux
2023-02-14
2023-02-08
Joachim
No

Hi,

most of the time, I only want to have a quick look at an attachment in the browser, instead of downloading it immediately, thereby cluttering up the Downloads folder and eventually being forced to open the folder and deleting the file. Both Chromium based browsers and Firefox are doing the latter. AFAIK this could be remedied at the server side. Would this be implying much work? It would give the WIKINDX users more freedom to download attachments only if they deem this as worthwile.

Best
Joachim

Related

Bugs and feature requests : #523

Discussion

  • Mark Grimshaw

    Mark Grimshaw - 2023-02-08

    Will look into it Joachim,

    Mark

     
    • Stéphane Aulery

      We can do it, this is a trivial change.

       
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-08

    Was thinking of a DIV like:
    https://stackoverflow.com/questions/2740297/display-adobe-pdf-inside-a-div

    This would open in the same tab and we could then add navigation buttons above the div to return to the resource or to download the file.

    Something for me to do?

    Mark

     
    • Stéphane Aulery

      I was thinking of changing the header's value from "Content-Disposition" to inline and keeping it opening in a blank page. Sometimes iframes are blocked.

       
      • Mark Grimshaw

        Mark Grimshaw - 2023-02-08

        I was thinking of this answer:

        <div>
            <object data="test.pdf" type="application/pdf" width="300" height="200">
                alt : <a href="test.pdf">test.pdf</a>
            </object>
        </div>
        

        Doing it inline would not allow anything else in the tab/window and I think it's more logical to keep it in a wikindx window with all the usual navigation (back to resource etc.) or choose something from the menu (instead of having to close the tab/window). Would doing it like this be a problem?

        Mark

         
        • Stéphane Aulery

          It is also an original solution. Why not. We need to test. This probably requires some PHP/JS code to handle extending/folding the div, handle multiple attachments in a single div, not cause preloading, and only do this for documents supported in browser previews.

           
          • Mark Grimshaw

            Mark Grimshaw - 2023-02-08

            I'll give it a go (but I wasn't thinking of something so complicated). I'll do something then you could have a look at it.

            Mark

             
            • Stéphane Aulery

              I look forward to seeing what you come up with.

               
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-08

    I currently have this.

    Anyway to find the browser width and height in PHP? (need to set width and height in the object element else the preview is very small.

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-08

    . . . not all mime types are supported (e.g. an XLSX file).

     
    • Stéphane Aulery

      Yes because the rendering is done by the browser and not delegated to an other software txt, html, pdf, ps should be supported.

       
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-08

    Hi Joachim,

    Something like this acceptable?

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-09

    Hi Joachim,

    It's now in SVN if you wish to check on a non-production server and give some feedback.

    Mark

     
    • Stéphane Aulery

      I committed a fix. You cannot access directly an attachment because there are stored without file extension. Without extension the server doesn't send the file with the right mimetype. This is emulated by downloadAttachment(). In addition it is better for security because we can add authorizations a posteriori.

       
    • Joachim

      Joachim - 2023-02-12

      Looks great, I installed it on my server. But inspite of the module in place (I even restarted the web server) this is what Firefox did when clicking on an attachment – downloading it right away (as did Vivaldi, a Chromium based browser) …

       
      • Mark Grimshaw

        Mark Grimshaw - 2023-02-14

        Any luck yet Joachim?

         
  • Mark Grimshaw

    Mark Grimshaw - 2023-02-12

    HI Joachim,

    I've tested it on Firefox, Chrome, Opera, and Safari. Some minor differences in how each displays but otherwise fine.

    When you are in resource view (or viewing only attachments in Advanced search), to see the preview, you must click on the attachment icon, not the attachment's file name (that downloads).

    Did you click on the icon?

    Mark

     

    Last edit: Mark Grimshaw 2023-02-13
    • Joachim

      Joachim - 2023-02-14

      Yes, I clicked the icon, same result as before. You can check yourself on my production server, where I replaced ATTACHMENTS.php with the new one. Maybe it only works in a complete SVN installation?

      1. Feb. 2023, 17:38 von sirfragalot@users.sourceforge.net:

      HI Joachim,

      I've tested it on Firefox, Chrosm, Opera, and Safari. some minor differences in how each displays but otherwise fine.

      When you are in resource view (or viewing only attachments in Advanced search), to see the preview, you must click on the attachment icon, not the attachment's file name (that downloads).

      Did you click on the icon?

      Mark

      [v5bugs:#523] https://sourceforge.net/p/wikindx/v5bugs/523/> Feature request: Inline browsing of attachments instead of downloads

      Status:> open

      Target:> Unknown
      Found in:> 6.7.0
      Created:> Wed Feb 08, 2023 04:21 PM UTC by Joachim
      Last Updated:> Sun Feb 12, 2023 04:29 PM UTC
      Owner:> Mark Grimshaw

      Hi,

      most of the time, I only want to have a quick look at an attachment in the browser, instead of downloading it immediately, thereby cluttering up the Downloads folder and eventually being forced to open the folder and deleting the file. Both Chromium based browsers and Firefox are doing the latter. AFAIK this could be remedied at the server side. Would this be implying much work? It would give the WIKINDX users more freedom to download attachments only if they deem this as worthwile.

      Best
      Joachim

      Sent from sourceforge.net because you indicated interest in > https://sourceforge.net/p/wikindx/v5bugs/523/

      To unsubscribe from further messages, please visit > https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs and feature requests : #523

      • Mark Grimshaw

        Mark Grimshaw - 2023-02-14

        Ah! I think that explains it. There were several files changed in order to do the rpeviewing, not just the one. You will need the whole SVN but do test on a non-production server.

        Mark

         

Log in to post a comment.