Currently, the URl is generated as e.g "webfm_send/5". With the change below, the URL will be generated as "webfm_send/5/filename.ext". This is especially practical when viewing documents in a browser or saving them, because now the filename is preserved.

The function Webfm.generateFileHref in file /js/webfm.js has to modified as follows (added "/title")

---------------------------------------------------------------
string = "" + title + "";
string = "" + title + "";
--------------------------------------------------------------
full function:
---------------------------------------------------------------
Webfm.generateFileHref = function(obj, url) {
if(typeof url == 'undefined') {
url = getBaseUrl();
}
var title = '';
if(typeof obj.ftitle != "undefined" && obj.ftitle != null && obj.ftitle.length)
title = obj.ftitle;
else
title = obj.element.title.substring(obj.element.title.lastIndexOf("/") + 1);

if(getWebfmCleanUrl()) {
string = "" + title + "";
} else {
string = "" + title + "";
}

return string;
}
-------------------------------------------------------------------

CommentFileSizeAuthor
webfm.patch742 bytesj.miserez

Comments

nhck’s picture

Category: bug » feature
Status: Patch (to be ported) » Closed (duplicate)

There already is this functionality:
#390252: Pretty URLs instead of "webfm_send"

ae860300’s picture

// 2009 judy file url Full path---------------------------------------------------------------------------------

  if(getWebfmCleanUrl()) {
   // string = "<a href=\"" + url + "\/webfm_send\/" + obj.element.id.substring(3) + "\">" + title + "</a>";
   string = "<a href=\"" + url + "/sites/default/files/files/" + title + "\">" + title + "</a>";
   ///dfm/sites/default/files/files/
  } else {
    //string = "<a _href=\"" + url + "\/?q=webfm_send\/" + obj.element.id.substring(3) + "\">" + title + "</a>";
	string = "<a href=\"" + url + "/sites/default/files/files/" + title + "\">" + title + "</a>";
  }

//--------------------------------------------------------------------------------------------------------------
return string;