Fix – call to a member function getclientoriginalextension() on null

In this short article, i will share how to fix call to a member function getclientoriginalextension() on null error. If you this error while uploading…

The post Fix – call to a member function getclientoriginalextension() on null appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Deven

In this short article, i will share how to fix call to a member function getclientoriginalextension() on null error.

If you this error while uploading an imagecall to a member function getclientoriginalextension() on null

This means that no file input has been seen for that file. So, check that you input something in each file input.

Consider the example below:

$file = Input::file('name');
if ($file !== null) {
    echo $file->getClientOriginalExtension();  
}

Alternatively, you can  use guessExtension() method for resolution. The guessExtension() method returns the extension based on the mime type.

Input::file('File')->guessExtension();

This methodology uses the mime type as guessed by getMimeType() to guess the file extension.

The post Fix – call to a member function getclientoriginalextension() on null appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Deven


Print Share Comment Cite Upload Translate Updates
APA

Deven | Sciencx (2021-02-10T18:10:53+00:00) Fix – call to a member function getclientoriginalextension() on null. Retrieved from https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/

MLA
" » Fix – call to a member function getclientoriginalextension() on null." Deven | Sciencx - Wednesday February 10, 2021, https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/
HARVARD
Deven | Sciencx Wednesday February 10, 2021 » Fix – call to a member function getclientoriginalextension() on null., viewed ,<https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/>
VANCOUVER
Deven | Sciencx - » Fix – call to a member function getclientoriginalextension() on null. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/
CHICAGO
" » Fix – call to a member function getclientoriginalextension() on null." Deven | Sciencx - Accessed . https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/
IEEE
" » Fix – call to a member function getclientoriginalextension() on null." Deven | Sciencx [Online]. Available: https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/. [Accessed: ]
rf:citation
» Fix – call to a member function getclientoriginalextension() on null | Deven | Sciencx | https://www.scien.cx/2021/02/10/fix-call-to-a-member-function-getclientoriginalextension-on-null/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.