Magento 2 - Create csv file for download in adminMagento2 ui_component - form - image file input fieldI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?adding save button with ui_component not workinguiComponent Form. How to show data from DB tableuiComponent Form Save Button Not workingMagento 2 : How can I upload files of dynamically added file input fields in the adminMagento 2.1.11 - adminhtml - Saving model to database with boolean field does not match valueHow to populate data in custom filed in product edit form in Magento 2Cannot export list of customer from the grid magento 2Magento 2 Create new “Catalog Input Type for Store Owner” Attribute
Sitecore Powershell extensions module compatibility with Sitecore 9.2
Where is this photo of a group of hikers taken? Is it really in the Ural?
USA: Can a witness take the 5th to avoid perjury?
Area of parallelogram = Area of square. Shear transform
What was the rationale behind 36 bit computer architectures?
Does static fire reduce reliability?
How can I make sure my players' decisions have consequences?
Why do people say "I am broke" instead of "I am broken"?
How can I prevent corporations from growing their own workforce?
The seven story archetypes. Are they truly all of them?
How can I receive packages while in France?
Grid/table with lots of buttons
Inverse Colombian Function
Why is the return type for ftell not fpos_t?
Why are angular mometum and angular velocity not necessarily parallel, but linear momentum and linear velocity are always parallel?
Moving files accidentally to an not existing directory erases files?
Why is a dedicated QA team member necessary?
"I you already know": is this proper English?
Why is chess failing to attract big name sponsors?
Where to place an artificial gland in the human body?
Is an easily guessed plot twist a good plot twist?
What do I do when a student working in my lab "ghosts" me?
How do I run a game when my PCs have different approaches to combat?
How can I tell if there was a power cut while I was out?
Magento 2 - Create csv file for download in admin
Magento2 ui_component - form - image file input fieldI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?adding save button with ui_component not workinguiComponent Form. How to show data from DB tableuiComponent Form Save Button Not workingMagento 2 : How can I upload files of dynamically added file input fields in the adminMagento 2.1.11 - adminhtml - Saving model to database with boolean field does not match valueHow to populate data in custom filed in product edit form in Magento 2Cannot export list of customer from the grid magento 2Magento 2 Create new “Catalog Input Type for Store Owner” Attribute
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to create a file in mangento 2 admin.
I'm using a button to get in a controller route.
My form ui component:
<item name="buttons" xsi:type="array">
<item name="save" xsi:type="string">VendorModuleBlockAdminhtmlReportEditExportButton</item>
</item>
I used a dummy data provider just for use the submit url:
<dataSource name="bvz_report_specifier_form_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">VendorModuleUiComponentFormDummyDataProvider</argument>
<argument name="name" xsi:type="string">bvz_report_specifier_form_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">entity_id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="submit_url" xsi:type="url" path="*/*/export"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
</dataSource>
In Vendor/Module/Controller/Adminhtml/Index/Export I creat an csv file and save it and put the name of file in URL.
Now I need to download this file when the page refresh.
In the index controller I have this code to make the download:
if($fileName = $this->getRequest()->getParam('file'))
$url = $mediaUrl = $this ->_storeManager-> getStore()->getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_MEDIA );
$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setUrl($url.$fileName);
The download happens but my page goes to infinite load. 
magento2 admin uicomponent controllers
add a comment |
I need to create a file in mangento 2 admin.
I'm using a button to get in a controller route.
My form ui component:
<item name="buttons" xsi:type="array">
<item name="save" xsi:type="string">VendorModuleBlockAdminhtmlReportEditExportButton</item>
</item>
I used a dummy data provider just for use the submit url:
<dataSource name="bvz_report_specifier_form_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">VendorModuleUiComponentFormDummyDataProvider</argument>
<argument name="name" xsi:type="string">bvz_report_specifier_form_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">entity_id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="submit_url" xsi:type="url" path="*/*/export"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
</dataSource>
In Vendor/Module/Controller/Adminhtml/Index/Export I creat an csv file and save it and put the name of file in URL.
Now I need to download this file when the page refresh.
In the index controller I have this code to make the download:
if($fileName = $this->getRequest()->getParam('file'))
$url = $mediaUrl = $this ->_storeManager-> getStore()->getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_MEDIA );
$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setUrl($url.$fileName);
The download happens but my page goes to infinite load. 
magento2 admin uicomponent controllers
add a comment |
I need to create a file in mangento 2 admin.
I'm using a button to get in a controller route.
My form ui component:
<item name="buttons" xsi:type="array">
<item name="save" xsi:type="string">VendorModuleBlockAdminhtmlReportEditExportButton</item>
</item>
I used a dummy data provider just for use the submit url:
<dataSource name="bvz_report_specifier_form_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">VendorModuleUiComponentFormDummyDataProvider</argument>
<argument name="name" xsi:type="string">bvz_report_specifier_form_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">entity_id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="submit_url" xsi:type="url" path="*/*/export"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
</dataSource>
In Vendor/Module/Controller/Adminhtml/Index/Export I creat an csv file and save it and put the name of file in URL.
Now I need to download this file when the page refresh.
In the index controller I have this code to make the download:
if($fileName = $this->getRequest()->getParam('file'))
$url = $mediaUrl = $this ->_storeManager-> getStore()->getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_MEDIA );
$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setUrl($url.$fileName);
The download happens but my page goes to infinite load. 
magento2 admin uicomponent controllers
I need to create a file in mangento 2 admin.
I'm using a button to get in a controller route.
My form ui component:
<item name="buttons" xsi:type="array">
<item name="save" xsi:type="string">VendorModuleBlockAdminhtmlReportEditExportButton</item>
</item>
I used a dummy data provider just for use the submit url:
<dataSource name="bvz_report_specifier_form_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">VendorModuleUiComponentFormDummyDataProvider</argument>
<argument name="name" xsi:type="string">bvz_report_specifier_form_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">entity_id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="submit_url" xsi:type="url" path="*/*/export"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
</item>
</argument>
</dataSource>
In Vendor/Module/Controller/Adminhtml/Index/Export I creat an csv file and save it and put the name of file in URL.
Now I need to download this file when the page refresh.
In the index controller I have this code to make the download:
if($fileName = $this->getRequest()->getParam('file'))
$url = $mediaUrl = $this ->_storeManager-> getStore()->getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_MEDIA );
$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setUrl($url.$fileName);
The download happens but my page goes to infinite load. 
magento2 admin uicomponent controllers
magento2 admin uicomponent controllers
edited Jul 16 at 8:36
Aasim Goriya
3,2961 gold badge12 silver badges43 bronze badges
3,2961 gold badge12 silver badges43 bronze badges
asked Jul 15 at 20:59
Gabriel FernandesGabriel Fernandes
677 bronze badges
677 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282160%2fmagento-2-create-csv-file-for-download-in-admin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282160%2fmagento-2-create-csv-file-for-download-in-admin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown