![]() |
Image resize and store in SQLite database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Image resize and store in SQLite database (/showthread.php?tid=87964) |
Image resize and store in SQLite database - csanesz - 06-28-2023 Hi, I have create one form, when the user upload the image to SQLite database Image stored in databse, not the server! Two problem. 1./ Image resize without save Code: $x_file = $this->request->getFile('file'); I have only Image object, which store in database blob field. I probe without save only resize(..); but its wrong! 2./ Database image write error Code: $fileData = [ Error message: SQLite3::exec(): incomplete input If I change the code: Code: 'Image' =addslashes(file_get_contents(WRITEPATH .'uploads/'. $xName)) The upload is Ok, but the table in BLOB field in binary string not the image: ff d8 ff e0 ... If I change the code: Code: 'Image' = file_get_contents(WRITEPATH .'uploads/'. $xName) The upload is Ok, but the BLOBL filed only 4 characters (ff d8 ff e0) Thanks a lot! RE: Image resize and store in SQLite database - JustJohnQ - 06-28-2023 Read: https://stackoverflow.com/questions/9357668/how-to-store-image-in-sqlite-database#comment18492686_9357668 |