I'm having some trouble when trying to manipulate image files, if anybody could tell what I'm possibly doing wrong, I'll be extremely grateful!
Situation 1:
I got a desktop application that is storing image files inside a MySQL database as a BLOB field.
So I need to get this content from my database and convert it to an JPG file and display inside my web application.
the first step is OK, I'm getting the right content from my database which, in this case, is a string with the BLOB content. Now, the problem is that the convertion to a JPG file is not working. That's what I'm trying to do:
Code: Select all
memowrit("C:\test\teste.jpg",cImage)
what is happening right here is that the BLOB content is not being coverted to a JPG file, instead it's saving the string content like a TEXT file but with the JPG extension.
Situation 2:
the user of my web application needs to send a file to my webservice (both developed with mod_harbour), so that my webservice must get this file and store it locally.
I know there's a way of sending this file inside my HTTP request, but I don't know exactly the headers and data that should go inside of it. Does anybody knows?
And after sending it, I don't really know exactly how to get this file from the request using Mercury and mod_harbour, is there any sample that explains how to do it?
Thanks!