View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
20041Bug reportsFile managerpublic2025-05-01 00:10
ReporterFreda Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status ready for code reviewResolutionopen 
Summary20041: No warning message if attachment have issue before email set
Description

Add file size limit for email attachments. Users can upload files that exceed PHP and server limits (upload_max_filesize, post_max_size), leading to failed uploads, Email sending errors without clear error messages.

Steps To Reproduce

Steps to reproduce

  • Create a simple survey
  • Add a few participants
  • Go to email templates (side menu) and add a large file as attachement (~11MB)
  • Activcate survey and try to send email invitation. An error message appears.

Expected result

  • The system should check the file size before uploading.
  • If the file exceeds the configured limit, an error message should be displayed, preventing the upload.
  • The error message should clearly state the maximum allowed file size based on the server configuration. (5MB)

Actual result

  • The file upload proceeds without validation.

  • If the file exceeds the limit, it fails with this Error message: There are errors with this template's attachment. Please check below.

  • The user can proceed to activate the survey, and when the try sending invite emails to participants there is another error.
    Error message: Could not instantiate mail function.

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build).
I will donate to the project if issue is resolvedNo
Browser.
Database type & version.
Server OS (if known)
Webserver software & version (if known)
PHP Version.

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2025-04-10 08:43

developer   ~82406

The system should check the file size before uploading.

I can not reproduce this part (see screenshot)
Can you check your upload_max_filesize in phpinfo ? maybe your post_max_size is lower than upload_max_filesize ?

@tibor.pacalat can you check ?

DenisChenu

DenisChenu

2025-04-10 08:43

developer   ~82407

Way to reproduce issue

Freda

Freda

2025-04-28 13:58

developer   ~82496

I was able to reproduce this error. it seems not to caused by files being large. It occurs if :

  1. A user copies a survey without checking the “ Copy survey resource files and adapt links “ box.
  2. If a user deletes the attached files in the resources and does not remove them from attachments.

Maybe the error message can be “There are errors with this template’s attachments. They do not exist/referenced path is incorrect.”

and we can proceed to close this issue.

DenisChenu

DenisChenu

2025-04-28 14:19

developer   ~82498

Last edited: 2025-04-28 14:19

OK !

Expected result

  1. Show warning on email template
  2. Shown warning when send email (on GUI)
  3. Send email without error
DenisChenu

DenisChenu

2025-04-30 11:22

developer   ~82540

Last edited: 2025-05-01 00:10

-[x] Show warning on email template
-[x] Shown warning when send email (on GUI)
-[ ] Send email without error (test with debug=2)
-[x] Send email without error (with debug=0)

DenisChenu

DenisChenu

2025-05-01 00:09

developer   ~82547

https://github.com/LimeSurvey/LimeSurvey/pull/4254

Issue History

Date Modified Username Field Change
2025-04-01 16:00 Freda New Issue
2025-04-01 16:00 Freda File Added: Screenshot 2025-04-01 at 15.57.37.png
2025-04-01 16:01 Freda Assigned To => DenisChenu
2025-04-01 16:01 Freda Status new => assigned
2025-04-10 08:43 DenisChenu Note Added: 82406
2025-04-10 08:43 DenisChenu File Added: Capture d’écran du 2025-04-10 08-40-15.png
2025-04-10 08:43 DenisChenu Bug heat 0 => 2
2025-04-10 08:43 DenisChenu Assigned To DenisChenu => tibor.pacalat
2025-04-10 08:43 DenisChenu Status assigned => feedback
2025-04-10 08:43 DenisChenu Note Added: 82407
2025-04-28 13:58 Freda Note Added: 82496
2025-04-28 13:58 Freda File Added: Screenshot 2025-04-28 at 13.37.50.png
2025-04-28 13:58 Freda Bug heat 2 => 4
2025-04-28 13:58 Freda Status feedback => assigned
2025-04-28 14:19 DenisChenu Note Added: 82498
2025-04-28 14:19 DenisChenu Note Edited: 82498
2025-04-28 14:19 DenisChenu Note Edited: 82498
2025-04-28 15:12 tibor.pacalat Assigned To tibor.pacalat => DenisChenu
2025-04-30 10:24 DenisChenu Summary Email templates - There is no File Size Check for Email Attachments. => Email with invalid files can not be sent
2025-04-30 11:22 DenisChenu Note Added: 82540
2025-04-30 11:36 DenisChenu Note Edited: 82540
2025-04-30 12:22 DenisChenu Summary Email with invalid files can not be sent => No warning message if attachment have issue before email set
2025-05-01 00:09 DenisChenu Assigned To DenisChenu => gabrieljenik
2025-05-01 00:09 DenisChenu Status assigned => ready for code review
2025-05-01 00:09 DenisChenu Note Added: 82547
2025-05-01 00:10 DenisChenu Note Edited: 82540