Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to configure webfm to link to my files directly instead of feeding them through webfm. The reason is that I use tons of PDFs and browsers will display the first pages of large PDFs immediately rather than the user having to wait for the entire PDF to load before anything is displayed at all. Now I would also like the files to open in a new browser window, but I have discovered that webfm flag.
Comments
Comment #1
webservant316 CreditAttribution: webservant316 commentedhello, anyone there?
Comment #2
cgmonroe CreditAttribution: cgmonroe commentedThis isn't built into WebFM... Since it conflicts with a bunch of WebaFM underlying design principals (Secure file access with .htaccess in plac; /single file for multiple attachments; and some others), it would be hard to implement.
Probably easier to write your own module that displayed webfm files with the direct URL than try to mod the JavaScript / PhP in WebFM.
Comment #3
webservant316 CreditAttribution: webservant316 commentedThanks for getting back. sorry to hear that it would be difficult to implement. If you were able to add it to your que of additions to the software it would be greatly appreciated. I may not be the only user interested in this feature because there is a significant difference when loading PDF files. As for the security issue, as long as it was the website admins had the choice, then they could determine if this is really a security issue to have the true path exposed.
Thanks again,
Jeff
Comment #4
webservant316 CreditAttribution: webservant316 commenteddirect links to webfm files would be a great asset to our use of your module.
could you take a few moments to expand on your suggestions of different ways to do that?
does webfm expose a direct link to the file in views?
or which module in webfm would need to be revised? in our case we would be just as happy to expose all direct file links.
then main reason I like webfm is that I do not want to upload files in Drupal's native upload utility via the browser.
instead I like webfm's ability to allow me to attach files that are already on the server.
hmmm, maybe there is another module that would enable me to do that, that does have direct links. know of one?
Jeff
Comment #5
cgmonroe CreditAttribution: cgmonroe commentedI haven't really messed about with views so I can't say... but I do remember that you probably need the -dev version for it to work correctly.
One place to look at this (and maybe fix your problem), is the theme_webfm_attahments($files) function. This is called to create the display of webfm files attached to a node. Since this is a theme function, you could override this in your theme to get the URL you want.
This might also be used in code generated pages to list WebFM uploaded files not attached. You'd have to figure out what information needs to be in the $files array and fill it with the files you want.
Comment #6
webservant316 CreditAttribution: webservant316 commentedthanks, I will try that.
is theme_webform_results_table() in webform_report.inc the theme function to override?
what is the variable with the direct link? $node->webform['components']['???directlink???']
thanks for any help.
Comment #7
nhck CreditAttribution: nhck commentedYou should really help and adopt this into a full module.
#941662: New input filter to dramatically improve performance.
Comment #8
webservant316 CreditAttribution: webservant316 commentedTried to get the new input filter proposed above at #7 to work but couldn't figure it out.
So I just did this for now...
>>added to line 2814 of webfm.module
Comment #9
webservant316 CreditAttribution: webservant316 commentedWhoa! Needed to and an exit() after the call to header().
Again at line 2814 of webfm.module