Kindly check this thread as a reference:
http://forums.asp.net/t/1677948.aspx/1?Indexing+Services+locks+saved+PDF+Files+on+Server+Folder+
I am using the following code to open the requested PDF file and render it back to the client:
Dim size As Long
Dim fs As New System.IO.FileStream(mFormFileNameFolder, FileMode.Open)
size = fs.Length
Dim buffer(size) As Byte
fs.Read(buffer, 0, size)
fs.Close()
WebResponse.ContentType = "application/pdf"
WebResponse.OutputStream.Write(buffer, 0, size)
result = True
In order to add error control in case indexing services need to be re-started, I did the following:
Go to the complete details ...