Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
blob to file
jhn Vln
3/28/2008 3:13:00 PM
Hi everyone,
I have a bunch of pdf files stored in a database (blob field) and now i
am asked to "transform" them into file system.
Is there any way to do that;
I tried something along the lines of
FileObject.find(:all).each do |fo|
f = File.new("#{fo.name}" + ".pdf", "w")
f << fo.file_field
f.close
f = nil
end
The files get created but when i try to open the newly pdf file created
they are blank (just blank pages in each doc)
Any ideas on this; any input is appreciated.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
blob to file
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password