Forum
Redactor file upload not working
If I go to upload a file within Redactor, the upload pop-up appears, and the file does upload to resources.
However, it does not link up right within the editor and the HTML from the file upload pop-up ends up being inserted into the content HTML, and this is repeated if uploading multiple files. It is very strange.
Here's the short diagnostic report (some paths altered slightly for privacy):
Perch: 2.8.4, PHP: 5.5.20, MySQL: 5.1.73, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.4), assets (2.8.4), categories (2.8.4)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/vhosts/x/webspace/httpdocs/perch
PERCH_CORE: /var/www/vhosts/x/webspace/httpdocs/perch/core
PERCH_RESFILEPATH: /var/www/vhosts/x/webspace/httpdocs/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 32M, Max POST 32M, Memory: 256M, Total max file upload: 32M
Resource folder writeable: Yes
DOCUMENT_ROOT: /var/www/vhosts/x/webspace/httpdocs
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Here's the code that gets inserted within the Redactor HTML
<div style="display: none; height: 1142px;" class="asset-chooser">
<div class="asset-topbar">
<div class="actions">
<a href="#" class="close icon asset-icon"><span class="hidden">Close</span></a>
<a href="#" class="add button">Add Asset</a>
<a href="#" class="select button">Use Selected</a>
</div>
<h2>Select an Asset</h2>
</div>
<div class="asset-drop">
<form action="/mificms/core/apps/assets/upload/" id="asset-dropzone" method="post" enctype="multipart/form-data">
<div class="fallback">
<input name="file" multiple="" type="file">
<input value="Upload" type="submit">
</div>
</form>
</div>
<div class="asset-field">
<div id="asset-filter" class="asset-filter">
</div>
<div style="position: relative; overflow: hidden; width: auto; height: 696px;" class="slimScrollDiv">
<div style="overflow: hidden; width: auto; height: 696px;" class="inner">
</div>
<div style="background: none repeat scroll 0% 0% rgb(0, 0, 0); width: 7px; position: absolute; top: 0px; opacity: 0.4; display: block; border-radius: 7px; z-index: 99; right: 1px;" class="slimScrollBar">
</div>
<div style="width: 7px; height: 100%; position: absolute; top: 0px; display: block; border-radius: 7px; background: none repeat scroll 0% 0% rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;" class="slimScrollRail">
</div>
</div>
</div>
</div>
Is this the latest version of Redactor?
Sorry, didn't realise that wasn't in the diagnostic. Yes, it's redactor 10.0.7 (or the current Perch plugin version 1.8)
What context does this happen in? It's testing out perfectly for us here.
We have been trying to debug this further, but if there's a bug, it's obscure.
We tried another page and uploading worked fine, but when my colleague tried the original problem page, the problem was there (file uploaded ok & link was in HTML too, but all the file uploader pop-up HTML had been inserted in the redactor field source messing up the whole field).
But we now can't even replicate it on the problem page! There was no strange HTML etc in the page content originally, so I don't know why we both had problems with that particular page and now it's fine.
Sorry for taking up your time. If the problem recurs we will try to get to the bottom of exactly what triggers it & report back.