Forum

Thread tagged as: Problem, Runway, Forms

Runway Form uploaded file appears in directory on server but not in assets in ad...

Have created working form with file upload field. On submission Runway handles form output as expected, sending email and saving in db. Uploaded file is sent with email successfully and does appear in the bucket directory on server if save response is checked however the uploaded files do not appear in Assets panel in admin.

buckets.php entry.

        'form-uploads' => array(
            'web_path'  => '/form-uploads',
            'file_path' => '/Applications/MAMP/htdocs/sqhc/form-uploads'
        ),

Here is debug from Assets filter by bucket

SELECT u.*, r.* FROM sqhc_users u, sqhc_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='fb15f64b7d7a7d3cee8eccc1df53220d' LIMIT 1
UPDATE sqhc_users SET userHash='75b4cdf10f301e85f7f264f2d88758de' WHERE userID='1'
[37] SELECT p.privKey FROM sqhc_user_privileges p
[24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM sqhc_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[3] SELECT collectionID, collectionKey, collectionEditRoles FROM sqhc_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT r1.*, r2.resourceFile AS thumb, r2.resourceWidth AS thumbWidth, r2.resourceHeight AS thumbHeight, r2.resourceDensity AS thumbDensity FROM sqhc_resources r1 LEFT OUTER JOIN sqhc_resources r2 ON r2.resourceParentID=r1.resourceID AND r2.resourceKey='thumb' AND r2.resourceAWOL!=1 WHERE r1.resourceKey='orig' AND r1.resourceAWOL=0 AND r1.resourceBucket='form-uploads' ORDER BY r1.resourceUpdated DESC, r1.resourceID DESC LIMIT 0, 30
[0] SELECT FOUND_ROWS() AS `count`
[4] SELECT DISTINCT resourceType FROM sqhc_resources WHERE resourceAWOL=0 AND resourceType !="" ORDER BY resourceType ASC
[3] SELECT DISTINCT resourceBucket FROM sqhc_resources WHERE resourceAWOL=0 AND resourceType !=""
Setting alert: You are viewing assets filtered by bucket ‘Form-uploads’ Clear Filter (filter)
Queries: 10
Memory: 2.8046

Diagnostics -

~~~Perch Runway: 2.8.32, PHP: 5.6.25, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO Server OS: Darwin, apache2handler Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_forms (1.8.3), collection_3 (2.8.32), collection_2 (2.8.32), collection_6 (2.8.32) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', ); PERCH_LOGINPATH: /site-admin PERCH_PATH: /Applications/MAMP/htdocs/sqhc/site-admin PERCH_CORE: /Applications/MAMP/htdocs/sqhc/site-admin/core PERCH_RESFILEPATH: /Applications/MAMP/htdocs/sqhc/site-admin/resources Image manipulation: GD PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: sqhc:8888 DOCUMENT_ROOT: /Applications/MAMP/htdocs/sqhc REQUEST_URI: /site-admin/core/settings/diagnostics/ SCRIPT_NAME: /site-admin/core/settings/diagnostics/index.php ~~~

Keith Winter

Keith Winter 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's correct - UGC doesn't appear in your assets panel.

What's the use case you're working towards?

Hi Drew Ok, good, thought I'd made a mistake somewhere in set up. UGC?

On reflection I can see it might be best for form uploaded files to not be available as assets. Intention is for CV upload.

I guess then I need to build a webpage that checks user is logged in as admin and lists files in the bucket directory?

Or is there a more elegant way of allowing access to these files. I do intend, once on live server, to have this bucket outside web root of course.

Is there a way of hiding unused buckets in Assets to avoid user adding files that way? I need to remove an unused bucket too, how can I achieve that? Thanks Keith

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are the files not showing as attached to their corresponding form entry?

Do you mean in the responses listing in Forms admin? If so, no, there are no associated uploaded files shown with submission listings. The file appears in the directory with random number prefixed to name as you'd expect though.

Drew McLellan

Drew McLellan 2638 points
Perch Support

They should be listed as a download link in the response detail.

Hi Drew No although I can see the files in the directory there is no link available with the stored responses.

I also don't see all the form output - text, textarea and select all there but radio and checkbox not?

Debug from response listing

SELECT u.*, r.* FROM sqhc_users u, sqhc_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='1984e2e205a5c9196f45b6c5e7b7efcb' LIMIT 1
UPDATE sqhc_users SET userHash='c9bf364b9d143ff2f5bcb2bd60afce0c' WHERE userID='1'
[37] SELECT p.privKey FROM sqhc_user_privileges p
[24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM sqhc_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[4] SELECT collectionID, collectionKey, collectionEditRoles FROM sqhc_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[1] SELECT * FROM sqhc_forms WHERE formID='2' LIMIT 1
[10] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM sqhc_forms_responses WHERE formID=2 AND responseSpam=0 ORDER BY responseCreated DESC LIMIT 0, 10
[16] SELECT FOUND_ROWS() AS `count`SELECT u.*, r.* FROM sqhc_users u, sqhc_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='1984e2e205a5c9196f45b6c5e7b7efcb' LIMIT 1
UPDATE sqhc_users SET userHash='c9bf364b9d143ff2f5bcb2bd60afce0c' WHERE userID='1'
[37] SELECT p.privKey FROM sqhc_user_privileges p
[24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM sqhc_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[4] SELECT collectionID, collectionKey, collectionEditRoles FROM sqhc_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[1] SELECT * FROM sqhc_forms WHERE formID='2' LIMIT 1
[10] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM sqhc_forms_responses WHERE formID=2 AND responseSpam=0 ORDER BY responseCreated DESC LIMIT 0, 10
[16] SELECT FOUND_ROWS() AS `count`

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do all your fields have the label attribute set?

Brilliant, sorry should have spotted that myself! Thanks

Still no uploaded file showing in response listing.

Any other ideas on that issue?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does the debug output give you for that page?

Form response listing page debug

SELECT u.*, r.* FROM sqhc_users u, sqhc_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='fd530e300d5132587ff3f884d5039a88' LIMIT 1
UPDATE sqhc_users SET userHash='1511e709f5f18b417cc88be070319d47' WHERE userID='1'
[37] SELECT p.privKey FROM sqhc_user_privileges p
[24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM sqhc_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[4] SELECT collectionID, collectionKey, collectionEditRoles FROM sqhc_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[1] SELECT * FROM sqhc_forms WHERE formID='2' LIMIT 1
[10] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM sqhc_forms_responses WHERE formID=2 AND responseSpam=0 ORDER BY responseCreated DESC LIMIT 0, 10
[19] SELECT FOUND_ROWS() AS `count`
Queries: 9
Memory: 2.8375
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks like a listing - what happens when you click through to an individual response?

My mistake, as there was a CSV download and the link to detail is not obvious I'd missed it. All good now on this issue thanks for your patience as always.