Here is my code which is thronging and error of the given is path is not supported,
here str holds my ftp file path.
salesid = cmbclient.SelectedValue
createdon = Today.Date.ToShortDateString
ReDim docimage(ob.ConvertImageToByteArray(str).Length)
docimage = ob.ConvertImageToByteArray(str)
createdby = UserName
filename = ListBox1.SelectedItem
srv.SaveInvoiceImage(salesid:=salesid, CB:=docimage, invoiceimage:=filename, createdon:=createdon, createdby:=createdby)
MsgBox("Image Approval Succedded", MsgBoxStyle.Information)
Public Function ConvertImageToByteArray(ByVal str As String) As Byte()
Dim fs As FileStream = New FileStream(str, FileMode.Open, FileAccess.Read)//error through here
Dim length As Integer = Convert.ToInt32(fs.Length)
Dim data() As Byte = Nothing
ReDim data(length)
fs.Read(data, 0, data.Length)
fs.Close()
Return data
What I have tried:
I have tried this
salesid = cmbclient.SelectedValue
createdon = Today.Date.ToShortDateString
ReDim docimage(ob.ConvertImageToByteArray(str).Length)
docimage = ob.ConvertImageToByteArray(str)
createdby = UserName
filename = ListBox1.SelectedItem
srv.SaveInvoiceImage(salesid:=salesid, CB:=docimage, invoiceimage:=filename, createdon:=createdon, createdby:=createdby)
MsgBox("Image Approval Succedded", MsgBoxStyle.Information)
Public Function ConvertImageToByteArray(ByVal str As String) As Byte()
Dim fs As FileStream = New FileStream(str, FileMode.Open, FileAccess.Read)error through here
Dim length As Integer = Convert.ToInt32(fs.Length)
Dim data() As Byte = Nothing
ReDim data(length)
fs.Read(data, 0, data.Length)
fs.Close()
Return data