Forum

Thread tagged as: Question, Problem

Files not appearing in asset list after upload

I'm trying to create a slideshow section for the homepage of a responsive, Perch-powered site. On the homepage I have the following code:

<?php perch_content('Homepage Slideshow'); ?>

I've set that content type up in Perch using the following repeater template:

<perch:repeater id="homepageSlideshow" label="Images for Homepage slideshow">
    <perch:before><ul class="list-plain list-slideshow cycle-slideshow" data-cycle-slides="> li" data-cycle-swipe="true"></perch:before>
    <li class="slideshow-item">
        <img src="<perch:content id="image" type="image" width="1044" height="450" label="Image" bucket="homepage_slideshow" />" alt="<perch:content type="text" id="alt" label="Description" required="true" help="Description of this image" title="true" />" srcset="<perch:content id="image" type="image" width="1044" height="450" label="Image" density="2" /> 2x, <perch:content id="image" type="image" width="1044" height="450" label="Image" density="3" /> 3x">
    </li>
    <perch:after></ul></perch:after>
</perch:repeater>

I've enabled Perch's debug mode, and I'm seeing this when the edit page is loaded:

Using template: /templates/content/homepage_slideshow.html
Form not posted or did not validate

I can see that the files are being uploaded - they're appearing in the resources > homepage_slideshow folder - but the larger versions aren't being generated, and nothing's appearing in the Assets panel.

Any ideas what's wrong?

Mike Armstrong

Mike Armstrong 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your Diagnostics Report?


Perch: 2.7.10 Production mode: Production (100) Installed apps: content (2.7.10), assets (2.7.10), categories (2.7.10) DB driver: PDO DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 1 App runtimes: <?php $apps_list = array( 'content', 'categories', ); Editor plug-ins: markitup H1: 3dc9d44db0ba0ffbc345c62c27de9e76 L1: b4ab5fac77932fcd92a50903768d902b headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 1 content_collapseList: 1 lang: en-gb update_2.7.10: done latest_version: 2.7.10 on_sale_version: 2.7.10 headerScheme: light dashboard: 1 content_hideNonEditableRegions: 1 hide_pwd_reset: 0 content_frontend_edit: 0 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: <REDACTED> PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: <REDACTED> PERCH_DB_PREFIX: perch2_ PERCH_TZ: UTC PERCH_EMAIL_FROM: <REDACTED> PERCH_EMAIL_FROM_NAME: <REDACTED> PERCH_LOGINPATH: /manage PERCH_PATH: <REDACTED>/webroot/manage PERCH_CORE: <REDACTED>/webroot/manage/resources PERCH_RESPATH: /manage/resources PERCH_HTML5: 1 PERCH_DEBUG: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: <REDACTED>/webroot/manage/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS PHP: 5.6.2 Zend: 2.6.0 OS: Darwin SAPI: apache2handler Safe mode: not detected MySQL client: 5.5.38 MySQL server: 5.5.38 Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, mysql, mysqli, session, PDO, pdo_sqlite, standard, posix, Reflection, Phar, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, mcrypt, yaz, pgsql, pdo_pgsql, pdo_mysql GD: Yes ImageMagick: No PHP max upload size: 32M PHP max form post size: 32M PHP memory limit: 128M Total max uploadable file size: 32M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes HTTP_HOST: dev.hxd.com HTTP_CONNECTION: keep-alive HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 HTTP_REFERER: https://dev.hxd.com/manage/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8 HTTP_COOKIE: cmsa=1; cmssb=0; PHPSESSID=6977802d423f466496373b0dcf10d863 PATH: /usr/bin:/bin:/usr/sbin:/sbin SERVER_SOFTWARE: Apache SERVER_NAME: dev.hxd.com SERVER_ADDR: 127.0.0.1 SERVER_PORT: 80 REMOTE_ADDR: 127.0.0.1 DOCUMENT_ROOT: <REDACTED>/webroot SERVER_ADMIN: <REDACTED> SCRIPT_FILENAME: <REDACTED>/webroot/manage/core/settings/diagnostics/index.php REMOTE_PORT: 64709 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /manage/core/settings/diagnostics/?extended SCRIPT_NAME: /manage/core/settings/diagnostics/index.php PHP_SELF: /manage/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1424357712.57 REQUEST_TIME: 1424357712 argc: 1

I've just noticed that ImageMagick wasn't enabled; I've turned it on, but still no joy...

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm not sure what's happened to that as it's all run together, but the short version would be fine then you don't need to edit it.

Here's the short version:

Perch: 2.7.10, PHP: 5.6.2, MySQL: 5.5.38, with PDO

Server OS: Darwin, apache2handler

Installed apps: content (2.7.10), assets (2.7.10), categories (2.7.10)

App runtimes: <?php $apps_list = array( 'content', 'categories', );

PERCH_LOGINPATH: /manage

PERCH_PATH: <REDACTED>/webroot/manage

PERCH_CORE: <REDACTED>/webroot/manage/core

PERCH_RESFILEPATH: <REDACTED>/webroot/manage/resources

Image manipulation: GD Imagick

PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M

Resource folder writeable: Yes

HTTP_HOST: <REDACTED>

DOCUMENT_ROOT: <REDACTED>/webroot

REQUEST_URI: /manage/core/settings/diagnostics/

SCRIPT_NAME: /manage/core/settings/diagnostics/index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

How large are the images you're uploading? I can see your 3x images will end up >3000px wide - are you just running out of memory?

The original uploaded asset is 1044 x 450px, at under 40kb; I've doubled the amount of memory available to PHP scripts to 256MB, but still no joy. The image appears briefly in the asset window when upload is complete, but then disappears.

Interestingly, I've tried removing the bucket="homepage_slideshow" section of my code, and the images seem to work. I've checked the permissions on the homepage_bucket folder and everything seems in order (though only the original image is being saved, not the higher-density ones); the images just aren't showing up in the Assets window.

Have I declared the bucket incorrectly? I tried putting the bucket on all three image inputs but that didn't make a difference. It appears that the automatic higher-density script doesn't play nicely with buckets, at least not the way that I've invoked it...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your bucket name is greater than the 16 characters maximum - that'll be the cause.