Problem/Motivation
By default, the exported file is saved within the public:// or private:// files directory with a path generated with /views_data_export/$view_dir/$user_dir/. The $user_dir is always unique because it includes the request time in seconds (Unix time stamp).
It would be nice to have the option of specifying an export directory. This would allow us to export to the same folder each time to overwrite the file if required.
Proposed resolution
Add a textbox field in the views form to allow user to enter an export path, with token support.
User interface changes
New textbox field on views config form.

| Comment | File | Size | Author |
|---|---|---|---|
| #9 | views-data-export-specify-export-directory-3265279-9.patch | 3.79 KB | liam morland |
Issue fork views_data_export-3265279
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
smulvih2Patch implements the new feature described in ticket description.
Comment #3
ConradFlashback commentedI tried #2.
It works for me, good feature!
Comment #4
gilles_c commentedFor the last version of the module.
Comment #7
liam morlandI have created a merge request with the patch in #4.
Comment #8
liam morlandI have rebased the merge request. There is one test assertion that fails. I don't understand how the changes in the merge request would cause this failure.
Comment #9
liam morlandCurrent state of merge request.
Comment #10
steven jones commentedI suppose this one is similar to #3268437: Save export file permanently in that you're presumably wanting to do something with the data after the export?
What's the use-case here please?
Are you doing the export via Drush or some sort of web-process?
Comment #11
man-1982 commentedHi @steven jones,
i don't know about @liam morland but i can describe case where we havily relya on this patch.
We have list of articles which changes pretty much frequently. Using views_data_export and this patch allows us save this list with a some changes under public web-site directory as an xml. After we just share this direct link to the file with our users.
such as www.examples.com/sites/defaul/files/feed/article_list.xml.
we have been using this patch since octomber 2025 and can confirm it works well
PS: As an improvements, would like to suggest including token module as a generator for folder name.
thanks