Skip to content
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

Option to save uploaded files in the same directory as the form itself #302

Open
domsson opened this issue Nov 21, 2018 · 4 comments
Open
Assignees

Comments

@domsson
Copy link

domsson commented Nov 21, 2018

The save action on forms comes with the options fileprefix and dateformat, which will be concatenated with a dash and used to create a directory within user/data. The form contents will then be saved in this directory in a file of the same name (plus extension). This is fantastic.

When there are file uploads in a form, the file field gives us the destination option, which is limited to self@ (the directory of the page the form is on), page@:<path>, theme@:<path> or <path>, which all let us navigate to a set (known) directory. This is nice, but does not cover a case that I thought was pretty obvious:

There seems to be no way to have the uploaded files be placed in the same directory as the form file itself. This would be very helpful however, as it enables us to have one directory per sent form, where all the form data (both the information as well as the uploaded files) can later be found.

Hence, I'm kindly asking for an additional option that will enable us to do this. My suggestion would be to add another possible value for destination, let's say save@ (someone can probably come up with a better name). Or maybe a new option altogether, like save-with-form: true|false.

Is this possible? Maybe there is a another (better) way to achieve the same?

@rhukster
Copy link
Member

It does appear this usecase is missing. I'll take a look at next week to see if this is possible.

@rhukster rhukster self-assigned this Nov 23, 2018
@domsson
Copy link
Author

domsson commented Feb 4, 2019

Just a follow up to see if you've already managed to look into this? Thank you so much.

@mahagr
Copy link
Member

mahagr commented Feb 15, 2019

We've not yet looked into this, but I may have an idea of how to fix this.

@domsson
Copy link
Author

domsson commented Apr 18, 2019

@mahagr Maybe you can share your idea? With a rough outline given, I might be able to wrap my head around the relevant code and implement a possible solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants