Hi there, I use php 7.0.10 on MODX Revolution 2.5.1-pl (traditional),
I have a prob with additional attachments to AjaxUpload. Uploading Images works fine. Uploading other stuff, a .pdf for example and I am getting an error.
Is it possible that it's the php-Version? I cannot switch the versions.
Here is my code, first the FormIt Call:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="ProLicht/Script/jquery-1.12.4.min.js"><\/script>')</script>
[[!FormIt?
&preHooks=`Formit2AjaxUpload`
&hooks=`AjaxUpload2Formit,AjaxUploadAttachments,math,spam,redirect,FormItAutoResponder,email`
&ajaxuploadFieldname=`image`
&ajaxuploadTarget=`../formularinhalte/`
&ajaxuploadUid=`image`
&emailHtml=`0`
&emailTpl=`MyEmailChunkNoHTML`
&emailTo=`[email protected]`
&emailSubject=`Daten aus dem Bewerbungsformular von [[++site_url]]`
&validate=`nospam:blank,
application:required:stripTags:minLength=^3^:maxLength=^75^,
name:required:minLength=^3^:maxLength=^75^,
phone:required:minLength=^3^:maxLength=^25^,
email:email:required,
text:required:stripTags:minLength=^3^:maxLength=^3000^
math:required`
&vTextRequired=`benötigt`
&vTextEmailInvalid=`Die E-Mail Adresse ist nicht korrekt.`
&vTextMinLength=`Zu wenig Zeichen.`
&vTextMaxLength=`Zu viele Zeichen.`
&validationErrorMessage=`Das Formular enthält Fehler und wird nicht versendet.`
&redirectTo=`258`
&store=`1`
&fiarReplyTo=`[email protected]`
&fiarTpl=`autoResponseTpl`
&fiarToField=`email`
&fiarFromName=`URL Name`
&fiarFrom=`[email protected]`
&fiarSubject=`Vielen Dank für Ihre Bewerbung`
&fiarHtml=`1`
]]
../formularinhalte/ exists and has writing permissions.
Now the AjaxUpload-Call.
[[!AjaxUpload?
&uid=`image`
&allowedExtensions=`jpg,jpeg,png,gif,tif,pdf,doc,docx,xls,xlsx,ppt,pptx,pps,ppsx,txt,rtf,zip,7zip`
&thumbX=`100`
&thumbY=`100`
&maxFiles=`6`
&maxFilesizeMb=`6`
]]
In the error-Log there is:
[2016-09-12 19:23:13] (ERROR @ /pages/core/model/modx/modconnectorresponse.class.php : 151) PHP warning: Cannot modify header information - headers already sent by (output started at /pages/core/model/phpthumb/phpthumb.filters.php:12)
Looks like the thumbnail cannot be created.
Something similar to this
https://forums.modx.com/thread/100091/no-thumbnails-in-media-browser-with-php-7-0-4 perhaps
After reloading the page the false document will be uploaded.
I even changed line 149 in
/pages/core/components/ajaxupload/model/ajaxupload/ajaxupload.class.php
$allowedExtensions = $this->modx->getOption('allowedExtensions', $properties, 'jpg,jpeg,png,gif');
But that did not change anything. Any clue anyone?