Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to get the exact uploaded image size by using getimagesize() php helper on Laravel 7. But i get an error

ErrorException: Undefined property: IlluminateHttpUploadedFile::$name on the line where the code is:

if($request->file('image') != null){
        $upload = $request->file('image');
        $sourceProperties = getimagesize($upload->name);

Please help understand the issues since it only occurs on the Debian server and not locally... It works fine on local

question from:https://stackoverflow.com/questions/65600355/undefined-property-illuminate-http-uploadedfilename-after-image-upload

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
224 views
Welcome To Ask or Share your Answers For Others

1 Answer

Not sure why but after using the php helper getRealPath() as:

getimagesize($upload->getRealPath());

Works on the server but not locally.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...