That's a whole lot of non-information. You may as well have said: "My car won't start, here's how I turn the key in the ignition, and this is the shape of the key I use, and it is a red key. please help me fix the problem!" None of that is useful information. At this point all we can say is "In principle, that should work, given all the prerequisites are in place." Since we don't know what all the prerequisites are, or if they are in place, cause you said nothing to that effect, best we can do is say "Well, it SHOULD work, no idea why it doesn't. Good luck figuring it out!" If you want us to help figure it out, you have to give us stuff to figure out with. There's also a bunch of usual-culprits you should have checked already and can report back so we know where to start looking, like: - Is there an error message, or does it just fail silently? - If an error message, what is it? - If it fails silently, how do you know it fails? Maybe the file is written "somewhere"? - Does your version of PHP and SQLite support that writefile() UDF? - Does it work normally, but not when you write the images? or does it never work? - Does the path exist? - What is the path? - Does the path have write permissions for the PHP user? - Can PHP normally write other files there (not via SQLite)? Have you tested this? - etc. That list can get very long so I will stop here and say please figure out at least those things, and eliminate every other possible problem you can think of, and then report back with exactly everything you have tried and the results of it. Maybe then, once we have puzzle pieces, can we help solve the puzzle. Good luck.