![]() |
Hi,
I am using CI 4 Version 4.4.1 and using Postman to post data using the apps API. In the HTTP Request i am uploading a file which ends in .png extension. The problem i get is with the getRandomName() function which is returning a file extension .bin instead. This is my code: PHP Code: $imageFile = $this->request->getFile('profile_image'); Code: $newImageNamex string (35) "1695474962_f067be8c9efe341ed38b.bin"
@sammyskills this is what i get when i do a var_dump($imageFile) :
Code: object(CodeIgniter\HTTP\Files\UploadedFile)#78 (10) { ["size":protected]=> int(47156) ["originalMimeType":protected]=> string(9) "image/png" ["path":protected]=> string(24) "C:\xampp\tmp\php3B74.tmp" ["clientPath":protected]=> string(14) "banner-img.png" ["originalName":protected]=> string(14) "banner-img.png" ["name":protected]=> string(14) "banner-img.png" ["error":protected]=> int(0) ["hasMoved":protected]=> bool(false) ["pathName":"SplFileInfo":private]=> string(24) "C:\xampp\tmp\php3B74.tmp" ["fileName":"SplFileInfo":private]=> string(11) "php3B74.tmp" }
@sammyskills
I resolved the problem. The problem was not the code but the uploaded file using RapidAPI Client extension in vs code. Thank your for the help.
Please edit your topic title and add [SOLVED] to the end of it
Thank you. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |