I want to execute a View and export the JSON file to the files directory. I am using Views Data Export and VDE drush add-on modules. My view has a file/PDF field and I want to provide a direct link to the PDF file. So I added a Views relation for the field and a file URI formatter field. When I go to see the output the View creates at the Path. The URL is an absolute link directly to the PDF file. The URL includes the domain name when viewing it on development or production instances. And this is what I want. This is the correct URL path in the JSON:
But when I use this Drush command below provided by
drush vde myview myviewid myfile.json
the domain name is stripped out like this:
Why is this happening only when using the Drush command? I found I can fix it by adding this at the end of the command
So my new drush command looks like this:
drush vde myview myviewid myfile.json --uri=mysite.com
But doing this will hardcode the domain name into the URL. I want the URL to work on development, production and on my local. Thank you for any help you can provide.