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;








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.
enter image description here










share|improve this question






























    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.
    enter image description here










    share|improve this question


























      0












      0








      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.
      enter image description here










      share|improve this question
















      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.
      enter image description here







      magento2 admin uicomponent controllers






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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




















          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
          );



          );













          draft saved

          draft discarded


















          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















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림