Forum
Runway: Cannot upload .xlsm file to Assets
Using Runway with paranoid mode enabled, I am unable to upload a .xlsm (MS Excel w/ macros) file to Assets. The progress meter completes and the file appears to upload, but then it doesn't appear in Assets. I did a Google search and it seems that the mime type for .xlsm is application/vnd.ms-excel.sheet.macroEnabled.12
, which appears in Runway filetypes.ini by default under the Office section.
Diagnostics:
HEALTH CHECK
Perch Runway is up to date
PHP 5.6.14-1+deb.sury.org~trusty+1 is up to date
MySQL 5.5.46-0ubuntu0.14.04.2 is up to date
Image processing available
SUMMARY INFORMATION
Perch Runway: 2.8.31, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_events (1.9.3), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_events', 'perch_forms', );
PERCH_LOGINPATH: /at-admin
PERCH_PATH: /var/www/public/axletech.dev/at-admin
PERCH_CORE: /var/www/public/axletech.dev/at-admin/core
PERCH_RESFILEPATH: /var/www/public/axletech.dev/at-admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: axletech.dev
DOCUMENT_ROOT: /var/www/public/axletech.dev
REQUEST_URI: /at-admin/core/settings/diagnostics/
SCRIPT_NAME: /at-admin/core/settings/diagnostics/index.php
Does it get moved to your resource bucket?
No it doesn't. PDFs, images, etc. are all working fine. This is the only file type I'm having problems with.
If you set
PERCH_VERIFY_UPLOADS
tofalse
does that help?Yes, that fixes it. Will disabling
PERCH_VERIFY_UPLOADS
affect form file uploads? I'm using<perch:input type="file" id="resume" accept="pdf office" label="Resume" />
in a form and I'd like to keep the security checks for uploads.This is a debugging step, not a recommendation for how you configure your site. Just trying to isolate the problem.
Can you show me your full diagnostics report?
Oh, ok. This is happening on both dev and staging, so here are full diagnostics for both:
Dev:
Staging:
Is
application/vnd.ms-excel.sheet.macroEnabled.12
what your server is reporting, or just what you looked up?Just what I looked up. How can I see what the server is reporting?
If you turn on debug and upload, you should see the error message pertaining to the validation stage.
I've switched on debug. I go to Assets > Add asset, click to upload, upload the .xlsm, the progress meter completes and the file drop area closes, but then the new asset is nowhere to be found and the debug message doesn't change or show any information about the file. Here is debug after trying to upload the file:
Can you try the traditional upload process without the JavaScript? You'll not see debug with a JavaScript upload because it happens in a different process.
I disabled javascript, uploaded the file and got this message:
I added
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
to filetypes.ini in the [office] section, but I'm still getting the same error when I try to upload the file.Just noticed
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
is already in filetypes.ini by default...filetypes.ini
doesn't factor here.We have
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
mapped to thexlsx
file extension. Is that inaccurate?.xlsx is regular Excel and .xlsm is Excel with macros, so I suspect they should both be mapped to that mime type.
Ok. I'm not sure I have a good solution for this in that case.
Uploading .xlsm is a requirement for my client, so I'm in a pinch. Will disabling PERCH_VERIFY_UPLOADS affect form file uploads, as in <perch:input type="file" id="resume" accept="pdf office" label="Resume" />? I only need to be able to upload these files via admin for now. Is this something that can be fixed in the next version of Runway?
PERCH_VERIFY_UPLOADS
only affects assets uploaded via the control panel.Thanks Drew. Several other sites confirm that the MIME type for .xlsm should be
application/vnd.ms-excel.sheet.macroenabled.12
which is what you have inperch/core/data/mime.types
, so I'm thinking this might be a problem with the way the client is saving the file in Excel.