Hello Magento Friends,

Today’s discussion is about How to Download Export File Directly Without a Cron Schedule in Magento 2.

Using Magento export functionality users can download CSV files of data. Export data into CSV file Programmatically in Magento 2

At that time cron is scheduled to carry out the export operation. But if the user wants to download the CSV file without cron scheduling, you can use the following code.

Steps to Download Export File Directly Without Cron Schedule in Magento 2:

Step 1: First, we need to create a “di.xml” file inside our extension at the following path

app\code\Vendor\Extension\etc\adminhtml\

Then add the code as follows

Step 2: After that, we need to create an “ Export.php” file inside the extension Controller directory

app\code\Vendor\Extension\Controller\Adminhtml\Export\

And add the below code snippet

Conclusion:

By doing so, you can Download Export File Directly Without Cron Schedule in Magento 2. If you have any doubt regarding the above steps, contact me via the comment section. I will be right back to you. Share the article with your friends and stay in touch with us!

Happy Coding!

Click to rate this post!
[Total: 1 Average: 5]