lo_export problem

I

incoroneta

Hi,

i'm trying to store a picture from the DB to the filesystem.
i've used the function lo_export like that:


res = conn.query("SELECT nome,physical_image FROM images;")

i=0
while(res!=nil)
conn.lo_export(res[1].to_i,'/home/andrea/senior/public/images/#{res[0]}.jpg')
i+=1

end


conn.close())

there're not errors, the script run...
The problem is that no files are created and i don't know why.
Can somebody help me??

thanks in advance...
 
J

John Joyce

Hi,

i'm trying to store a picture from the DB to the filesystem.
i've used the function lo_export like that:


res = conn.query("SELECT nome,physical_image FROM images;")

i=0
while(res!=nil)
conn.lo_export(res[1].to_i,'/home/andrea/senior/public/images/#
{res[0]}.jpg')
i+=1

end


conn.close())

there're not errors, the script run...
The problem is that no files are created and i don't know why.
Can somebody help me??

thanks in advance...

Check out the IO and File libraries.
ri File
ri IO
also, in Ruby it's a good idea to put spaces before and after
operators...
i += 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,981
Latest member
satome

Latest Threads

Top