Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Member List  Search  FAQ  Ticket List  Log Out

 

Restore a fax from a SQL Archive

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Archiving & Fax] >> GFI FAXmaker >> Restore a fax from a SQL Archive Page: [1]
Login
Message << Older Topic   Newer Topic >>
Restore a fax from a SQL Archive - 15.Nov.2007 10:30:40 PM   
bfarinella

 

Posts: 17
Joined: 7.Nov.2007
Status: offline
Has anyone had to restore a fax from an archive that stored in an SQL DB? I need to restore one but I optd not to archive to a folder on the server, rather to the SQL DB.

Thank you,

Bill
Post #: 1
RE: Restore a fax from a SQL Archive - 20.Nov.2007 12:27:50 PM   
perrybutler

 

Posts: 3
Joined: 20.Nov.2007
Status: offline
Yes it works fine.  I'm using ASP.NET 2.0 to retrieve the record from the database and then stream the image (which is stored as binary) into a file download.  I have a gridview which lists all the fax records and a hyperlink column configured with a querystring containing the id.

Here's some code to get the image as a file download, but you can do whatever you want with the bytes in this example:

      ' get the id from the page url
      Dim id As String = Request.QueryString("id")

      ' create the sql command
      Dim cmd As New SqlClient.SqlCommand("SELECT [attdata] FROM [fm_faxout_att] WHERE [id] = @id", New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString))
      cmd.Parameters.AddWithValue("@id", id)

      ' get the data
      Dim reader As SqlClient.SqlDataReader
      Dim bytes() As Byte
      cmd.Connection.Open()
      reader = cmd.ExecuteReader
      reader.Read()
      bytes = reader("attdata")

      ' activate the download
      Response.AddHeader("Content-disposition", "attachment; filename=" & Request.QueryString("n"))
      Response.ContentType = "application/octet-stream"
      Response.BinaryWrite(bytes)
      Response.End()

      ' clean up
      reader.Close()
      cmd.Connection.Close()
      cmd.Dispose()

< Message edited by perrybutler -- 20.Nov.2007 12:29:40 PM >

(in reply to bfarinella)
Post #: 2
RE: Restore a fax from a SQL Archive - 28.Nov.2007 12:26:45 PM   
bfarinella

 

Posts: 17
Joined: 7.Nov.2007
Status: offline
Perry,

Could you provide the ASP page that you use to retreive the grid listing?

Bill

(in reply to perrybutler)
Post #: 3
RE: Restore a fax from a SQL Archive - 19.Jun.2008 10:23:48 AM   
bfarinella

 

Posts: 17
Joined: 7.Nov.2007
Status: offline
Sorry but I am new to programming and scripting I understand that the script above will allow me to download the attachment but how do I create the interface to run the script?

(in reply to bfarinella)
Post #: 4
RE: Restore a fax from a SQL Archive - 27.Jun.2008 1:15:42 PM   
JoeKern

 

Posts: 293
Joined: 28.Apr.2008
Status: offline
bfarinella,

GFI is currently working an a very alph utility that will allow this functionality.  As of now it is not available to the public but should be shortly.  Just wanted to give you a heads up.

_____________________________

Joe Kern - JKern@gfi.com
Technical Support Representative - GFI Software - www.gfi.com Messaging, Content Security & Network Security Software

(in reply to bfarinella)
Post #: 5
RE: Restore a fax from a SQL Archive - 3.Mar.2009 10:50:43 AM   
infinityinc

 

Posts: 1
Joined: 31.Jul.2008
Status: offline
Joe,

Did this basic utility ever become available?

Thanks!

(in reply to JoeKern)
Post #: 6
RE: Restore a fax from a SQL Archive - 22.Jun.2009 1:31:22 PM   
bfarinella

 

Posts: 17
Joined: 7.Nov.2007
Status: offline
Joe,

Has this become available yet?

Bill

(in reply to infinityinc)
Post #: 7
RE: Restore a fax from a SQL Archive - 6.Aug.2009 9:01:55 AM   
bfarinella

 

Posts: 17
Joined: 7.Nov.2007
Status: offline
Does anyone know if this utility is available yet?

Bill

(in reply to bfarinella)
Post #: 8
Page:   [1]
All Forums >> [Archiving & Fax] >> GFI FAXmaker >> Restore a fax from a SQL Archive Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts