Handling image and other files

Responder
Avatar de Usuario
ricardo arraes
Mensajes: 87
Registered for: 3 years 5 months
Brazil

Handling image and other files

Mensaje por ricardo arraes »

Hey everybory, happy new year!

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:

Código: Seleccionar todo

memowrit("C:\test\teste.jpg",cImage)
*cImage is the BLOB content retrieved from de database.

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!
The work always comes before the belief

Otto
Mensajes: 50
Registered for: 3 years 5 months
Austria

Mensaje por Otto »


Avatar de Usuario
ricardo arraes
Mensajes: 87
Registered for: 3 years 5 months
Brazil

Mensaje por ricardo arraes »

Thank you so much, Otto!
Imma take a look at your code
The work always comes before the belief

Responder