- 🇮🇳India anil280988
I faced the similar issue,and even log shows that file can't be copied from tmp folder to public/private folder. But looking at the code I found that it's the generic error message that is shown when file can't be created. In my case the issue was the file name format, I was adding timestamp token at the end and it has spaces. Removing that I was able to create the file.
- 🇬🇧United Kingdom kewesley
We had a similar issue to #5 where a non-admin user could not download an export in the private files directory, which we fixed by implementing a separate hook in one of our custom modules. I wonder if the regex is overcomplicating things? We are using
$file->getOwnerId()
to determine who created the export.use Drupal\Core\Access\AccessResult; use Drupal\Core\Session\AccountInterface; use Drupal\file\FileInterface; function MYMODULE_file_access(FileInterface $file, $operation, AccountInterface $account) { // Allow access to temporary private file exports. if ($operation === 'download' && $file->isTemporary() && str_contains($file->getFileUri(), '://views_data_export/')) { if ($file->getOwnerId() === $account->id()) { return AccessResult::allowed(); } } return AccessResult::neutral(); }
- 🇺🇦Ukraine vasyok
Hello guess.
How can you think its really possible to place exported file in file system?I choose filename
Change export method to Batch
But nothing happen. This Initializing line doesn't grow.
- 🇬🇧United Kingdom steven jones
@vasyok I don't think you want the
public://
prefix on the filename. - 🇧🇪Belgium weseze
We had the same issues. Just use this module instead: https://www.drupal.org/project/xls_views_data_export →
Works perfectly fine for us. - 🇬🇧United Kingdom steven jones
Ah @vasyok the storage of the file on disk in any specific location should really be consider a side-effect of running the export.
If you want to run the export and capture the contents to some other file on disk, then you either need another process doing the saving or get involved in ✨ Support views data export using drush Needs review .
I'm going to close this issue because batched exports are working fine for at least me and the automated tests, but feel free to re-open the ticket if the batch export isn't working for people on this ticket, when using it via the current API: i.e. clicking links in the browser.