How i can get Image/file Extension from uploaded image using _fileUploaderFactory in Magento 2Magento - get...

Why is there so much iron?

Can other pieces capture a threatening piece and prevent a checkmate?

Is there a creature that is resistant or immune to non-magical damage other than bludgeoning, slashing, and piercing?

Geography in 3D perspective

What does "^L" mean in C?

Print a physical multiplication table

Loading the leaflet Map in Lightning Web Component

Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?

What favor did Moody owe Dumbledore?

Why didn't Héctor fade away after this character died in the movie Coco?

How do hiring committees for research positions view getting "scooped"?

What does Jesus mean regarding "Raca," and "you fool?" - is he contrasting them?

PTIJ: Why do we blow Shofar on Rosh Hashana and use a Lulav on Sukkos?

Are dual Irish/British citizens bound by the 90/180 day rule when travelling in the EU after Brexit?

Describing a chess game in a novel

What are substitutions for coconut in curry?

Can a wizard cast a spell during their first turn of combat if they initiated combat by releasing a readied spell?

How is the partial sum of a geometric sequence calculated?

How can an organ that provides biological immortality be unable to regenerate?

When did antialiasing start being available?

Light propagating through a sound wave

Violin - Can double stops be played when the strings are not next to each other?

Do I need to consider instance restrictions when showing a language is in P?

Practical application of matrices and determinants



How i can get Image/file Extension from uploaded image using _fileUploaderFactory in Magento 2


Magento - get uploaded file name in form upload fieldFile is not being uploaded from front endFile upload option is appearing serialized in cartMagento 2: Image Upload JS ValidationMultiple file uploads through a single inputMagento 2 Add new field to Magento_User admin formUpload File Magento 2How to check number file uploaded reach to limit in component uploadermagento 2 : logo image file could not be selected / uploaded2.3.0 Watermarks not showing on product images













1















I am Working on custom Module In Magento 2 I m trying to upload image to database using fileUploaderFactory.



try {
$uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);
$uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
$uploader->setFilesDispersion(false);
$uploader->setAllowRenameFiles(true);
$path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('backgroundimage/');
$filename=$data['title'].$data['date_from'];
$filename = str_replace(' ', '_', $filename);
$uploader->save($path,$filename);

} catch (Exception $e) {
$this->messageManager->addError(__($e->getMessage()));
}


File is Upload in database but i m not getting File extension that is why file is not showing in my GRID list



Anyone please Guide










share|improve this question









New contributor




Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    I am Working on custom Module In Magento 2 I m trying to upload image to database using fileUploaderFactory.



    try {
    $uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);
    $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
    $uploader->setFilesDispersion(false);
    $uploader->setAllowRenameFiles(true);
    $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('backgroundimage/');
    $filename=$data['title'].$data['date_from'];
    $filename = str_replace(' ', '_', $filename);
    $uploader->save($path,$filename);

    } catch (Exception $e) {
    $this->messageManager->addError(__($e->getMessage()));
    }


    File is Upload in database but i m not getting File extension that is why file is not showing in my GRID list



    Anyone please Guide










    share|improve this question









    New contributor




    Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      I am Working on custom Module In Magento 2 I m trying to upload image to database using fileUploaderFactory.



      try {
      $uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);
      $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
      $uploader->setFilesDispersion(false);
      $uploader->setAllowRenameFiles(true);
      $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('backgroundimage/');
      $filename=$data['title'].$data['date_from'];
      $filename = str_replace(' ', '_', $filename);
      $uploader->save($path,$filename);

      } catch (Exception $e) {
      $this->messageManager->addError(__($e->getMessage()));
      }


      File is Upload in database but i m not getting File extension that is why file is not showing in my GRID list



      Anyone please Guide










      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am Working on custom Module In Magento 2 I m trying to upload image to database using fileUploaderFactory.



      try {
      $uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);
      $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
      $uploader->setFilesDispersion(false);
      $uploader->setAllowRenameFiles(true);
      $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('backgroundimage/');
      $filename=$data['title'].$data['date_from'];
      $filename = str_replace(' ', '_', $filename);
      $uploader->save($path,$filename);

      } catch (Exception $e) {
      $this->messageManager->addError(__($e->getMessage()));
      }


      File is Upload in database but i m not getting File extension that is why file is not showing in my GRID list



      Anyone please Guide







      magento2 file-upload uploader file-uploader






      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 11 mins ago









      HIren Kadivar

      738214




      738214






      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 14 mins ago









      Waqar AliWaqar Ali

      62




      62




      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















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


          }
          });






          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266260%2fhow-i-can-get-image-file-extension-from-uploaded-image-using-fileuploaderfactor%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








          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.













          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.












          Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f266260%2fhow-i-can-get-image-file-extension-from-uploaded-image-using-fileuploaderfactor%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

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          夢乃愛華...