Forum
Perch Form attached files not downloading from Perch
Hi,
Files uploaded through a form are not downloading when clicked on in Perch. The error I am getting is:
Array
(
[type] => 8
[message] => Trying to get property of non-object
[file] => /Volumes/Data/g Websites/newgateclocks/newgate-clocks/admin/addons/apps/perch_forms/modes/response.detail.pre.php
[line] => 20
)
This is the upload section in my form:
<perch:label for="fileupload">Please upload a CV or your portfolio (Please note we only accept PDF or Office documents)</perch:label>
<perch:input type="file" id="fileupload" label="Upload CV" accept="pdf office richtext" bucket="job_applications" />
The link looks like this:
https://newgateclocks.dev/admin/addons/apps/perch_forms/responses/detail/?id=790&file=fileupload
The files are uploading to the specified folder fine.
This is my diagnostics:
SUMMARY INFORMATION
Perch Runway: 2.8.34, PHP: 7.0.13, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (1.0.11), perch_shop_products (1.0.11), perch_shop (1.0.11), perch_members (1.5), perch_mailchimp (3.0.1), perch_twitter (3.6.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_mailchimp', 'perch_twitter', 'perch_members', 'perch_shop', 'perch_blog' );
PERCH_LOGINPATH: /admin
PERCH_PATH: /Volumes/Data/g Websites/newgateclocks/newgate-clocks/admin
PERCH_CORE: /Volumes/Data/g Websites/newgateclocks/newgate-clocks/admin/core
PERCH_RESFILEPATH: /Volumes/Data/g Websites/newgateclocks/newgate-clocks/admin/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
HTTP_HOST: newgateclocks.dev
DOCUMENT_ROOT: /Volumes/Data/g Websites/newgateclocks/newgate-clocks
REQUEST_URI: /admin/core/settings/diagnostics/
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
Not seen that one before. Does anything useful show up in debug?
I had the same issue: https://forum.grabaperch.com/forum/11-21-2016-2-problems-with-perch-form-with-uploads
Switching back to PHP5.6 cured it. I've not been able to detect what is different between PHP5.6 and PHP7 to cause the problem.
Thanks Simon - yes I upgraded to PHP7 yesterday so I guess that is what is causing my problems, thanks.
Yes just tested by rolling back to 5.6 and the downloads work again.
Drew, if you could help me work out what the issue is that would be great. What information would you need?
Hi Drew,
I have run a diff on the two php.ini files - there are a lot of differences and I am not sure which are relevant. This is a link to the results:
https://www.diffchecker.com/g4A8150e
If you could find the time to take a look that would be great. In addition to that in Perch these are the listed extensions in my Diagnostics, items in bold are present in one not the other:
5.6
Core, date, ereg, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, calendar, ctype, curl, dom, fileinfo, ftp, gd, iconv, imap, json, mbstring, mysqlnd, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, SimpleXML, sockets, sqlite3, tokenizer, xml, wddx, xmlreader, xmlwriter, xsl, mhash, ionCube Loader
7.0
Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, calendar, ctype, curl, dom, fileinfo, ftp, gd, iconv, imap, json, mbstring, mysqlnd, PDO, Phar, posix, SimpleXML, sockets, sqlite3, tokenizer, xml, xmlwriter, xsl, mysqli, pdo_mysql, pdo_sqlite, wddx, xmlreader, Zend OPcache
The following extensions are available but not installed for PHP7.0 in my EasyApache 4 PHP Extensions manager in WHM:
This is the debug in Perch prior to clicking the file link:
And this is it after:
Hi Drew,
Did you have any thoughts on this? I have had no luck so far asking my hosts
It's logged to look into.
Great, thanks. If you need anything further from me please let me know