I inherited a DB where files were stored in a SQL Server 2000 database as images. I want to pull these out of the database and save them to the server as physical files. I am having trouble figuring out a way to do this. Now I can pull the data out of the DB and get it to open on my PC, but all my attempts to make it save directly to the server have failed. Here is my code that simply opens the file:
That is just an example of one file - There are over 3000 files embedded in this SQL table so saving one by one and then moving them to the server is not really an option. I would like to simply be able to loop through and save each file to the server. Any ideas on how to do this would be GREATLY appreciated!!!
Thanks in advance!
Code:
fsql = "select * from filelibrary.dbo.documents where did = 31"
set frs = conn.execute(fsql)
myfile = frs("binObj")
mymime = frs("mimeType")
response.ContentType= mymime
Response.AddHeader "Content-Disposition","inline; filename=Test.doc"
Response.BinaryWrite(myfile)
That is just an example of one file - There are over 3000 files embedded in this SQL table so saving one by one and then moving them to the server is not really an option. I would like to simply be able to loop through and save each file to the server. Any ideas on how to do this would be GREATLY appreciated!!!
Thanks in advance!