Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
Public Function DownloadFile(request As DownloadRequest) As RemoteFileInfo _ Implements IService.DownloadFile Dim result As New RemoteFileInfo() Try Dim filePath As String = System.IO.Path.Combine("c:\Uploadfiles", request.FileName) Dim fileInfo As New System.IO.FileInfo(filePath) ' check if exists If Not fileInfo.Exists Then Throw New System.IO.FileNotFoundException("File not found", request.FileName) End If ' open stream Dim stream As New System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read) ' return result result.FileName = request.FileName result.Length = fileInfo.Length result.FileByteStream = stream Catch ex As Exception End Try Return result End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.