1

I have created a custom module. Which adds a custom tab on product_edit page. Custom tab have multiple images and text boxes. this all include in 1 custom form like this...

<form action="<?php echo $baseurl.'admin/AdminSample/sampleOne';?>" method="post" enctype="multipart/form-data">

and i want on Save button click the form should call controller in which i can handle all posted data.

I have tried call controller using basepath, but it always redirect me to admin dashboard.

1

Calling of admin url of echo $baseurl.'admin/AdminSample/sampleOne'; is not wrong idea.

If you want call admin url then you should try

$this->getUrl('AdminSample/sampleOne')

at block class.

  • I got the inputs, but still i want the image details like name, size, type, tmp_name, etc. – Mandar Parbate Apr 19 '17 at 9:25
  • i Got this much – Mandar Parbate Apr 19 '17 at 9:29
  • Array ( [fileToUpload1] => 54874.png [fileToUpload2] => 88286.png [fileToUpload3] => facebook.png [fileToUpload4] => sandisk-ultra-dual-drive-sddd3-016g-i35-original-imaenuzggxzwqcfh.jpeg [fileToUpload5] => stock-vector-white-textile-banners-vector-template-ready-for-your-text-and-design-153620174.jpg ) – Mandar Parbate Apr 19 '17 at 9:30
  • i want all images descriptions – Mandar Parbate Apr 19 '17 at 9:30
0

You can achieve this by following two methods.

  1. Use GET method to get all the form data, Like this

    <form action="<?php echo $baseurl.'admin/AdminSample/sampleOne';?>" method="GET" enctype="multipart/form-data">

  2. Or Please go through this link https://www.softprodigy.com/store/article/how-to-upload-multiple-iimage-in-admin-backend-in-magento2/

you will get an suitable answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.