11 years ago
1
Topic

Hello,


I'm having trouble getting the download link for a field type "Upload - File" with SEF URL.


At the moment I get a URL like:

http://myurl.com/component/cck/?task=download&file=general_file&id=49

I would like to get something like

http://myurl.com/download/filename

Is this possible at all with the Upload - File field type?


I have tried all different settings in Content->Link + Markup for that field. But the link always stays the same.

In my position override to render the contents, I call the link to the field with

<?php echo $cck->get('general_file')->link; ?>

If I use

<?php echo $cck->getValue('general_file'); ?>

 I get the path to the file like "images/files/filename.pdf" which is more like a SEF link.


But still I would like to use the download link functionality that I get with

<?php echo $cck->renderField('general_file'); ?>
and have a SEF URL.


Any ideas? Thank you.

Get a Book for SEBLOD
11 years ago
0
Level 1

As a workaround I am using the value of the field now which gives me the path to the file.

To make it look somewhat like an SEF URL, I am using a folder structure like:

/downloads/nameofcontentype/.


This way I get a link like http:.../downloads/nameofcontenttype/nameoffile.filetype


That is at least better than the standard

http://myurl.com/component/cck/?task=download&file=general_file&id=49

Get a Book for SEBLOD