Forum

Thread tagged as: Question, Problem

All assets being inserted as images

Is there a way to control the output from an asset tag uploaded from within SimpleMDE? When uploading files, or when inserting existing files (pdf or docx), I get the expected [cms:asset 1234] in the editor but the generated output is always wrapped in image tags; ie:

<img src="/resources/myfile.pdf" alt="My File Title"> instead of just /resources/myfile.pdf or <a href="/resources/myfile.pdf">My File Title</a>

I feel like I must be missing something; any help would be appreciated.

EDIT: Can't reply to this thread because it's closed. If anyone has the same problem: the solution was to enable the php fileinfo extension.

Alan Longstaff

Alan Longstaff 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I should be an image when you use the image button, and a file when you use the file button. Is that not happening?

Both the image upload and the file upload output image tags onto the page. I've just tried it in a test environment and it works as expected, so I'm guessing it's not a template issue. My diagnostic info in case it's useful:

Perch: 3.0.5, PHP: 7.0.9, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.0.5), assets (3.0.5), categories (3.0.5), perch_blog (5.5.1), perch_events (1.9.5), perch_forms (1.9), perch_gallery (2.8.9), perch_twitter (3.7)
App runtimes: <?php $apps_list = array( 'content', 'perch_blog', 'perch_forms', 'perch_gallery', 'perch_twitter', 'perch_events', 'categories' ); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: E:\Sites\hpoolsfc\www\perch
PERCH_CORE: E:\Sites\hpoolsfc\www\perch\core
PERCH_RESFILEPATH: E:/Sites/hpoolsfc/www/resources
Image manipulation: GD
PHP limits: Max upload 30M, Max POST 32M, Memory: 256M, Total max file upload: 30M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: hpoolsfc.ac.uk
DOCUMENT_ROOT: E:/Sites/hpoolsfc/www/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

You're on an old version. Is it still happening once you're up to date?

Sorry, I didn't realise there were any newer versions than I was currently using (you guys update too quickly haha). I've updated to 3.0.8 but I unfortunately still have the same issue.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, we'll run some tests.

Thanks Drew

Is there any update on this? I'm experiencing the same issue.