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.

Views data export new views field for export directory config

Command icon 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

smulvih2 created an issue. See original summary.

smulvih2’s picture

Status: Active » Needs review
StatusFileSize
new3.56 KB

Patch implements the new feature described in ticket description.

ConradFlashback’s picture

I tried #2.
It works for me, good feature!

gilles_c’s picture

For the last version of the module.

liam morland made their first commit to this issue’s fork.

liam morland’s picture

I have created a merge request with the patch in #4.

liam morland’s picture

I 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.

liam morland’s picture

Current state of merge request.

steven jones’s picture

Status: Needs review » Postponed (maintainer needs more info)

I 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?

man-1982’s picture

Hi @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