logisticinfotech / laravel-file-upload

laravel file upload extension blank problem

Home Page:https://www.logisticinfotech.com/blog/laravel-upload-file-issue-getclientoriginalextension/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In Laravel when uploading files sometime getClientOriginalExtension() returns empty string.

The getClientOriginalExtension() method returns the original file extension. It is extracted from the original file name that was uploaded. Then it should not be considered as a safe value.

We should use guessExtension() method for resolution.

The guessExtension() method returns the extension based on the mime type.

You can find our blog from this link

About

laravel file upload extension blank problem

https://www.logisticinfotech.com/blog/laravel-upload-file-issue-getclientoriginalextension/


Languages

Language:PHP 94.6%Language:HTML 4.8%Language:Vue 0.6%