-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Form support file upload? #6027
Comments
Or more importantly does the workflow support file upload? |
There is no support for file upload through workflows right now. Related issues #4896 |
OK - let me try to implement a task for the workflow that handle a file upload. |
This is a good simple activity task to learn from https://github.com/EtchUK/Etch.OrchardCore.Workflows/tree/master/FormOutput |
If anyone need similar functionality, this code will work
|
Because the Form widget doesn't support multiple, you have to modify the generated html with Javascript
|
This is my first time writing a custom activity task so this one is gonna be rough at the edges. |
@dodyg |
There you go. You need to modify the code to make it more robust but all the necessary ingredients are there. |
@dodyg |
Thanks a lot @dodyg .. very detailed and useful explanation as usual 🥇 |
@dodyg I updated your Task to include liquid support on the folder. |
I've done something similar around two months ago and maybe I'm allowed to add some thoughts about security and validation. Fields:
Optional fields:
Feature field:
|
I think the save part needs to change so if someone is using cloud blob storage then it would also work. Seems like its hardcoded to the local filesystem. |
@stevetayloruk Yup. This is just a quick and dirty implementation for my local project purpose. |
What about having such a task by default in the project? Maybe it should only use the media service. And we'd need to have a way to use a custom folder that can't serve files publicly. But we'd be able to browse them from the admin. |
@sebastienros This would be really great. In case of option 2, I've extended the OrchardCore.Email module to support attachments which would be really helpfull as default functionality. The ability to choose wheter a media folder is public or private would be awesome, because I would really like to store files inside the media, that are only available through the admin panel, so I don't have to save my files outside of the media folder with a hardcoded path anymore. |
@sebastienros Is there any plans to have media folders/files securable through the permission system? What would your approach be to achieve this? |
Per role, per folder:
In the attached media field, we already do that, by forcing a custom folder, and not showing other ones. Bonus feature (harder):
I think it should be done at the folder level to simplify the UI. |
I didn't see anything in the Workflow nor the Form widget support for "multipart/form-data"
The text was updated successfully, but these errors were encountered: