getgrav / getgrav/grav-plugin-form
Add a new field named basic-file to allow you to use a basic solution for uploading files
- Dominant language
- PHP
- Stars
- 64
- Forks
- 80
- Avg merge
- 10h 13m
- Merged PRs (30d)
- 9
Description
Hi
the file type solution as some problems:
- in file.html.twig file there are some js files which are loaded if there is a file type field in the form
- image data is loaded into the body of the email, including the file field label. All this data is not important in managing a message, usually the uploaded files must be attached to the email, technical data is not important, in fact it distracts from the message sent
- the jquery file is loaded by force, then two other files and one has a very large size greater than 600Kb. in total with these files 1Mb of code are loaded just for the file field.
This reduces the loading of the pages and if the form is inserted in all the pages of the site it becomes a problem.
now I no longer use jquery and therefore having to do it just for this thing I don't like
I've been trying for 3 hours, I've done a lot of tests, but the form only sends the files if you use the dz-preview section
You can also remove the javascript files but then it doesn't work, for sending the files the input field of type file is not considered, the js file is used to do it, then the form.php file expects various data on the files
I would like the files to be attached to the emails without the image data being reported in the body of the email, including the label which is not important
the "form" plugin is not able to handle a normal "file" type field and attach files to emails in a simple way
the only solution is to create a new basic-file type field, but it must be done in the php files too

would it be possible to add a new basic-file field, which shows in the form the classic field where you can upload files and then these are inserted only as attachments to the emails sent?
it would be a solution appreciated by everyone
thanks
bye
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing file.html.twig and form.php to understand how the current file field loads JavaScript, reads uploads, and passes data to email handling. Compare the existing dz-preview-dependent flow with the requested basic-file field. Done means a standard file input can send uploaded files as email attachments without embedding file data or its label in the email body.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100