Uploaded file not attaching to email

prophoto

Active Member
I don't know what I'm doing wrong. I setup the File Upload element in a form, checked the box to email files, but there are no attachments. I'm using the Ajax uploader. on J4.4.9 F4.1 and PHP8.1.29. Files are stored locally.
 
Set J! error level to max, maybe it's showing something.
Is your J! GlobalConfig tmp path set and writable?
 
Update.
  • Fixed ModSecurity issues
  • Fixed open_basedir restrictions
  • Had to abandon local uploads and switched to AWS S3 SDK uploads since open_basedir is enabled and the scripts are pointing to the /images/uploadfolder instead of absolute path /var/www/vhosts/domain.com/httpdocs/images/uploadfolder
  • created required home folder for ~/wwwuser/.aws/config
  • Upgraded to F4.4.1
  • Upgraded to F4.2 libraries
File uploads are working to AWS S3. I cannot download from list view. I have download scripts turned on. Getting this error when I try to download. Files are being uploaded to S3 just fine. Files are not corrupted when downloaded directly from S3.

Code:
substr(): Argument #1 ($string) must be of type string, stdClass given

Still getting this php error

Code:
[proxy_fcgi:error] [pid 18348:tid 140176584009472] [client 12.34.56.78:61521] AH01071: Got error 'PHP message: PHP Warning:  Undefined array key "created" in /var/www/vhosts/domainname.com/httpdocs/administrator/components/com_fabrik/models/element.php on line 650', referer: https://domainname.com/administrator/index.php?option=com_fabrik&view=element&layout=edit&id=23

Final issue. 0 byte files are being attached to emails with filenames like "email_zNukON.pdf,params}]".

1730931108885.png
 
I don't get this error and files are attached (jpg + pdf).
filenames like "email_zNukON.pdf,params}]".
Is this a fileupload in a repeat group?

No idea if this is working with open_basedir restrictions.
 
I'm not getting any more open_basedir errors so I think I'm past that. No repeating groups. Ajax upload, restricted to 1 file. PDF only.
 
max1 is working here, too.

What are your email plugin settings?
If you select "debug_with_labels" as php template, what does it show in your email?
 
Using debug template shows all fields if I empty the message field but there is no link in the upload field shown. Tried turning off open_basedir for now. File attachment still has odd name. 0 bytes.
 
Email plugin settings nothing major. just set to backend only, both new and edit, to address, subject line. Thats it.
 
there is no link in the upload field shown.
Element label and no link but the file name? Or only the label and nothing else?

I assume the "odd name" is the reason.
email_zNukON.pdf,params}]:
email_xxx.ext is created as tmp file if you don't use local storage and obvioulsy there's something wrong with the extension.

I don't have any amazon3 so I can't test.
If you want to debug: have a look in plugins\fabrik_element\fileupload\fileupload.php
what it's doing around line 3186


Can you try with local storage again?
Do you have any setting here?
1730966012062.png
 
Turned off clean filename. WIP and safety check unchanged, set to no. Rename code empty.

Went back to local storage and no attachment. Tried S3 again and no change. Email has 0 byte attachment with ",params}]:" at end of filename.
 
As I said it's working on my site.

You may try to set the fileupload emailing to no and add the file(s) in form email "Attachments(eval)".
 
hours and hours later still having same issue with bad filename and empty file. It looks to me like the filename is not being processed correctly? This is the array, is it possible that you're including 'params' in the filename incorrectly?

Array\n(\n [0] => /var/www/vhostsdomain.com/httpdocs/tmp/email_ouX0ys.pdf","params":"null"}]\n)\n'

After looking at this more closely it seems the path is missing a / after vhosts. Why would that be when the file is in s3? Somewhere the code is writing this tmp path wrong.

configuration.php is correct.

public $log_path = '/var/www/vhosts/domain.com/httpdocs/administrator/logs';
public $tmp_path = '/var/www/vhosts/domain.com/httpdocs/tmp';
 
Last edited:
0 byte Files are being written to /tmp.

[centos@server7 tmp]$ ls /var/www/vhosts/domain.com/httpdocs/tmp

email_61yjyi.pdf","params":"null"}] email_dwRNCq.pdf","params":"null"}] email_KNIIO5.pdf","params":"null"}] email_ouX0ys.pdf","params":"null"}] email_uEuHjw.pdf","params":"null"}]
email_aZh5jK.pdf","params":"null"}] email_jAZaNf.pdf","params":"null"}] email_lB9VQG.pdf","params":"null"}] email_RXhAwa.pdf","params":""}] index.html
email_DDkCgo.pdf","params":"null"}] email_jvKbPj.pdf","params":"null"}] email_m6hiU3.pdf","params":"null"}] email_RZhifh.pdf","params":"null"}]
 
Back
Top