I was trying to link a word to the direct download of the file and I noticed when using this module with file_entity that linkit generates links to the file entity itself and not the file download path.

The ability to have direct downloads was added here http://drupalcode.org/project/file_entity.git/commit/24c34b0fa15c5c6a0c1... to the file entity module.

Is there someway you could provide an option(checkbox) "Direct Download" or something like that. Maybe provide a place to set the default of where linkit links link to(the file entity or the download)

http://drupal.org/project/ckeditor_link_file does something similar.

Thank you for making this great module.

Comments

gmclelland’s picture

Oops, I thought I was running the latest dev. I just noticed that the latest dev now links to the file path itself. Great!

Maybe there should still be an option checkbox to "force download" when inserting a link to a file?

gmclelland’s picture

Status: Active » Closed (works as designed)

FYI... you can't link file/id/download anymore since token protection has been added to the latest file_entity-2.x-dev.

I think the best route is to continue linking directly to file like this module does now. If needed you might be able to use https://drupal.org/project/portable_path with this module to correct the links if the file is ever moved.

treksler’s picture

Title: Support linking to file/%file/download » Support linking to direct downloads of files
Issue summary: View changes
Status: Closed (works as designed) » Active

looks like link it 3.x-dev links to file/%file
Also, it looks like linking to file/%file/download is a no go.

How do you propose one would link to a direct download of a file by fileid or token, without linking directly to the file on disk?
Seems like a fairly basic requirement of a file management system.

gmclelland’s picture

From what I understand in 2.x, linkit linked to directly to the file on disk.

In 3.x, linkit links to the file entity file/%id with the file_entity module?

To restore the 2.x way you can see/review the posted patch #2158107: files: link inserted does not point to download but to entity page ("/file/FID" instead of "/system/files/FILEPATH")

I no longer need the ability to link to file/%id/download.

treksler’s picture

Thanks for the link to the patch. It gives me some ideas how to go forward.

My issue is that linking directly to the URL is IMO a bad idea.

My users will/might/could be switching files between private and public systems or renaming files, etc. Running hacks to fix filepath links in umpteen nodes and fields makes me come out in a cold sweat.

I think file/%id is better than linking to the URL. So, the patch in #2158107 is a step backwards.
I wish there was a display mode to print a link to the file, not to the entity (like file/%id/download was supposed to work)

Options.
1) make a patch to LinkIt that links to managed file id tokens instead? and use the input format from portable paths?
2) leave LinkIt alone and use http://drupal.org/project/rabbit_hole to redirect file entity pages to their download URLs
3) leave LinkIt alone and make an input format, which converts file/%id URLs to the file download URLs on display

PS
couldn't get rabbit hole to work, but was able to do the redirect via the "ctools page manager existing pages" module by overriding file/%fid and adding a variant for redirecting to %file:url

anon’s picture

Status: Active » Closed (duplicate)
anon’s picture