Welcome Guest, Not a member yet? Register   Sign In
Storing images in database using active record
#13

[eluser]jppi_Stu[/eluser]
What about Base64-encoding the image data before storing it and decoding it when you retrieve it?
Code:
$book = array(
            'title' => $this->input->post( 'title' ),
            'cover' => base64_encode($cover)
);
Then your data won't need any escaping. This will increase storage requirements and would presumably decrease performance, but those may not be the most critical considerations if you really need to store images directly in the database.

(In general, I find it disappointing when someone asks how to accomplish something and others only tell them not to do it at all, without having any knowledge about the reasons behind the original inquiry. If it's a bad idea, go ahead and say so, but provide an answer too. Sometimes the bad idea is the lesser of evils.)


Messages In This Thread
Storing images in database using active record - by El Forum - 10-18-2010, 05:44 AM
Storing images in database using active record - by El Forum - 10-18-2010, 10:03 PM
Storing images in database using active record - by El Forum - 10-19-2010, 06:59 AM
Storing images in database using active record - by El Forum - 10-19-2010, 08:15 AM
Storing images in database using active record - by El Forum - 10-19-2010, 09:21 AM
Storing images in database using active record - by El Forum - 10-19-2010, 10:09 AM
Storing images in database using active record - by El Forum - 10-19-2010, 10:41 AM
Storing images in database using active record - by El Forum - 10-19-2010, 11:12 AM
Storing images in database using active record - by El Forum - 10-19-2010, 12:49 PM
Storing images in database using active record - by El Forum - 10-19-2010, 03:12 PM
Storing images in database using active record - by El Forum - 10-19-2010, 03:53 PM
Storing images in database using active record - by El Forum - 10-19-2010, 04:12 PM
Storing images in database using active record - by El Forum - 10-19-2010, 04:28 PM
Storing images in database using active record - by El Forum - 10-21-2010, 02:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB