On Drupal 6.10, I am using FileField with CCK 6.x-2.1 and using it to create a field called "audio_file". It is a place to upload an mp3 to the individual node. When I go to Views (6.x-2.3), I use a fields view and tell it to rewrite the audio file field as a link, so I put this:

<a href="[field_audio_file_fid]">Audio</a>

But it spits out the field like this:

<a href="<div class="filefield-file clear-block"><div class="filefield-icon field-icon-audio-mpeg"><img class="field-icon-audio-mpeg" alt="audio/mpeg icon" src="/sites/all/modules/filefield/icons/protocons/16x16/mimetypes/audio-x-generic.png" /></div><a href="/sites/default/files/122108.mp3" type="audio/mpeg" length="16819976" title="122108.mp3">122108.mp3</a></div>">Audio</a>

So, apparently there is some visual code in the actual filefield, something that looks like this:
<div class="filefield-file clear-block"><div class="filefield-icon field-icon-audio-mpeg"><img class="field-icon-audio-mpeg" alt="audio/mpeg icon" src="/sites/all/modules/filefield/icons/protocons/16x16/mimetypes/audio-x-generic.png" /></div><a href="/sites/default/files/122108.mp3" type="audio/mpeg" length="16819976" title="122108.mp3">122108.mp3</a></div>

How do i fix that?

Comments

quicksketch’s picture

It looks like you've selected the "Content: [Label of field] (field_[name_of_field)" field to add to your view. This outputs data for display including HTML (as you've noticed). To get the File path instead, add a relationship for that field, then add the "File: Path" field. You can then use the token "[filepath]" as a replacement token.

wakeband’s picture

Status: Active » Closed (fixed)

Thanks so much! That worked. closing issue.