Forum

Thread tagged as: Problem, Error, Redactor

Redactor not uploading files into specified bucket

Hello!

When uploading files to my blog post with the Redactor editor (textarea field type), files are put in the wrong place.

Instead of uploading to my specified bucket, Redactor is uploading files to the default /resources bucket. I haven't had this problem when uploading images and files with a dedicated image or file field type.

Here is the textarea field from my post.html template:

<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="redactor" html="true" size="xxl autowidth" required="true" imagewidth="896" imageheight="896" imagecrop="false" imagequality="0" imagedensity="2" imagesharpen="2" bucket="blog" />

Here are my diagnostics (let me know if you’d prefer the extended report, instead):

SUMMARY INFORMATION

Perch: 2.8.14, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, cgi-fcgi
Installed apps: content (2.8.14), assets (2.8.14), categories (2.8.14), perch_blog (4.6), perch_forms (1.8.3), perch_podcasts (1.1), perch_twitter (3.5.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_podcasts', 'perch_twitter' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/abby/Sites/_clients/fwc/fwc-2015/perch
PERCH_CORE: /Users/abby/Sites/_clients/fwc/fwc-2015/perch/core
PERCH_RESFILEPATH: /Users/abby/Sites/_clients/fwc/fwc-2015/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /Users/abby/Sites/_clients/fwc/fwc-2015
HTTP_HOST: fwc-2015.dev

In an ideal world, I would be using a Markdown editor, instead, but the blog is a port from WordPress and using Redactor seemed like the best way to migrate that HTML tagged content with a minimum of cleanup.

Abby Larsen

Abby Larsen 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Are you on the most recent version of the plugin from our site?

Does the bucket exists and is it writable? You say you've uploaded other images - were these to the same bucket or another one?

Abby Larsen

Abby Larsen 0 points
Registered Developer

I’ve just confirmed that I’m using the most recent version of the Redactor plugin — v1.9. I confess I modified /perch/addons/plugins/editors/redactor/perch/edit.css after reading about the bug fix in this post, hopefully that isn't an issue. :/

The bucket exists and is writable. I was able to upload to the bucket via an image field type (e.g. feature image field for the post). I’ve also uploaded to other buckets for pages outside of the blog, but always using either an image or a file field type, not a textarea.

For what it’s worth, the behavior when I click the 'insert an image' button in Redactor is much simpler than that of uploading a file/image using a file or image field type. I assumed that that is simply the nature of the Redactor upload function. For example, there is no message about what bucket one might be uploading one's image to, and there is no way, that I can tell, to access previously uploaded assets from the Assets library.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are there any errors in your log?

Abby Larsen

Abby Larsen 0 points
Registered Developer

I just performed a test upload of an image to a blog post using Redactor — while keeping an eye on the php_error.log for MAMP Pro (is that the log you mean?) — and didn't see any new lines written. There were lots of other php errors in the log from previous dev trial and error on this project, so I would expect an upload error would show up there. The image is otherwise processed as it should be, resized correctly, at least, but ends up in /perch/resources instead of /perch/resources/blog.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I think I've fixed this if you want to try the new version of the plugin.

Abby Larsen

Abby Larsen 0 points
Registered Developer

That seems to have done it! Thank you so much!

Drew McLellan

Drew McLellan 2638 points
Perch Support

No problem!