File upload form in custom admin moduleImage doesn't upload in custom module magentoAdmin layout file not loading in custom moduleMagento - get uploaded file name in form upload fieldUnderstanding code and praticalProduct Doesn't Update Information in Admin Edit - Magento 2How to override the file name.phtml in my custom module: Magento-2Manually upload file to serverMagento 2.3.0 Get Country NameMagento2 : Save Button Not Working in Admin Form Custom ModuleAJAX call returns the same page html
Is it ok for parents to kiss and romance with each other while their 2- to 8-year-old child watches?
In layman's terms, does the Luckstone just give a passive +1 to all d20 rolls and saves except for death saves?
Taking my Ph.D. advisor out for dinner after graduation
Floating Pumice Road. Slab Size
What does "spinning upon the shoals" mean?
Who goes first? Person disembarking bus or the bicycle?
Intern not wearing safety equipment; how could I have handled this differently?
Uniform initialization by tuple
Can the Four Elements monk's Shape the Flowing River elemental discipline create stairs by expending a single ki point?
What purpose does mercury dichloride have in fireworks?
What is the meaning of "prairie-dog" in this sentence?
Tesco's Burger Relish Best Before End date number
Examples of fluid (including air) being used to transmit digital data?
Is it acceptable that I plot a time-series figure with years increasing from right to left?
Was it ever illegal to name a pig "Napoleon" in France?
I don't want to be introduced as a "Minority Novelist"
Why do airports remove/realign runways?
How can I review my manager, who is fine?
Possibility to correct pitch from digital versions of records with the hole not centered
Is conquering your neighbors to fight a greater enemy a valid strategy?
What are the consequences for a developed nation to not accept any refugee?
Where are the Wazirs?
What does the multimeter dial do internally?
What's the difference between a type and a kind?
File upload form in custom admin module
Image doesn't upload in custom module magentoAdmin layout file not loading in custom moduleMagento - get uploaded file name in form upload fieldUnderstanding code and praticalProduct Doesn't Update Information in Admin Edit - Magento 2How to override the file name.phtml in my custom module: Magento-2Manually upload file to serverMagento 2.3.0 Get Country NameMagento2 : Save Button Not Working in Admin Form Custom ModuleAJAX call returns the same page html
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm creating a custom admin module in which i need a form to upload a csv file
Here is the code:
Controller file:
app/code/Importa/Import/Controller/Adminhtml/Import/Index.php
<?php
namespace ImportaImportControllerAdminhtmlImport;
use MagentoBackendAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends MagentoBackendAppAction
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
)
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->resultPageFactory->create();
return $resultPage;
?>
Layout file:
app/code/Importa/Import/view/adminhtml/layout
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
Template file:
app/code/Importa/Import/view/adminhtml/templates/sample
<form action="" method=post enctype="multipart/form-data">
<p>Seleziona file</p> <br>
<input type=file name=userfile> <br>
<input type=submit value=Invia name=conferma>
</form>
The problem is that i don't know what the action url to refer the template to the index.php file.
php magento-2.1.7
add a comment |
I'm creating a custom admin module in which i need a form to upload a csv file
Here is the code:
Controller file:
app/code/Importa/Import/Controller/Adminhtml/Import/Index.php
<?php
namespace ImportaImportControllerAdminhtmlImport;
use MagentoBackendAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends MagentoBackendAppAction
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
)
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->resultPageFactory->create();
return $resultPage;
?>
Layout file:
app/code/Importa/Import/view/adminhtml/layout
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
Template file:
app/code/Importa/Import/view/adminhtml/templates/sample
<form action="" method=post enctype="multipart/form-data">
<p>Seleziona file</p> <br>
<input type=file name=userfile> <br>
<input type=submit value=Invia name=conferma>
</form>
The problem is that i don't know what the action url to refer the template to the index.php file.
php magento-2.1.7
add a comment |
I'm creating a custom admin module in which i need a form to upload a csv file
Here is the code:
Controller file:
app/code/Importa/Import/Controller/Adminhtml/Import/Index.php
<?php
namespace ImportaImportControllerAdminhtmlImport;
use MagentoBackendAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends MagentoBackendAppAction
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
)
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->resultPageFactory->create();
return $resultPage;
?>
Layout file:
app/code/Importa/Import/view/adminhtml/layout
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
Template file:
app/code/Importa/Import/view/adminhtml/templates/sample
<form action="" method=post enctype="multipart/form-data">
<p>Seleziona file</p> <br>
<input type=file name=userfile> <br>
<input type=submit value=Invia name=conferma>
</form>
The problem is that i don't know what the action url to refer the template to the index.php file.
php magento-2.1.7
I'm creating a custom admin module in which i need a form to upload a csv file
Here is the code:
Controller file:
app/code/Importa/Import/Controller/Adminhtml/Import/Index.php
<?php
namespace ImportaImportControllerAdminhtmlImport;
use MagentoBackendAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends MagentoBackendAppAction
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
)
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
public function execute()
$resultPage = $this->resultPageFactory->create();
return $resultPage;
?>
Layout file:
app/code/Importa/Import/view/adminhtml/layout
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
Template file:
app/code/Importa/Import/view/adminhtml/templates/sample
<form action="" method=post enctype="multipart/form-data">
<p>Seleziona file</p> <br>
<input type=file name=userfile> <br>
<input type=submit value=Invia name=conferma>
</form>
The problem is that i don't know what the action url to refer the template to the index.php file.
php magento-2.1.7
php magento-2.1.7
edited Aug 14 '17 at 10:35
Teja Bhagavan Kollepara
3,0014 gold badges20 silver badges51 bronze badges
3,0014 gold badges20 silver badges51 bronze badges
asked Aug 14 '17 at 10:32
Roberto BarileRoberto Barile
261 silver badge8 bronze badges
261 silver badge8 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
you need to modify app/code/Importa/Import/view/adminhtml/layout/import_index_inde.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
to
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoBackendBlockTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
add a comment |
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%2f189054%2ffile-upload-form-in-custom-admin-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
you need to modify app/code/Importa/Import/view/adminhtml/layout/import_index_inde.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
to
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoBackendBlockTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
add a comment |
you need to modify app/code/Importa/Import/view/adminhtml/layout/import_index_inde.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
to
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoBackendBlockTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
add a comment |
you need to modify app/code/Importa/Import/view/adminhtml/layout/import_index_inde.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
to
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoBackendBlockTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
you need to modify app/code/Importa/Import/view/adminhtml/layout/import_index_inde.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
to
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>
Importa
</title>
</head>
<body>
<referenceContainer name="content">
<block class="MagentoBackendBlockTemplate" name="Importa" template="Importa_Import::sample/importa.phtml" />
</referenceContainer>
</body>
</page>
answered Feb 9 '18 at 12:21
Charvi ParikhCharvi Parikh
6997 silver badges18 bronze badges
6997 silver badges18 bronze badges
add a comment |
add a comment |
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%2f189054%2ffile-upload-form-in-custom-admin-module%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