Good Afternoon,<BR><BR>I am having a problem creating a PDF file with ASP..<BR>Basically I am trying to create a pdf file within the secure "global" directory. When I try to open a pdf file normally<BR>I receive a network dialog bow, because its looking for the userid and password to log onto the server.<BR>To overcome this, I wrote the following code to counteract this and create/view filesas a textstream in the global directory.<BR>However, when using the FSO to read the file, it cannot find it, even though it is present in the global directory. it does not matter whether I use a relative path or an actual path, it still cannot find the pdf page.<BR><BR>If you can spot where I am going wrong here, it would be apreciated.<BR><BR>ASP Code<BR><BR>&#060;%<BR> On Error Resume Next<BR> Response.buffer = true<BR><BR> Dim objBinFile, objFSO, objFile<BR> Dim mFile, mMapFile<BR><BR> &#039; Custom server component<BR> Set objBinFile = Server.CreateObject"BusObj.clsASPBinFile")<BR><BR> &#039; FSO <BR> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR><BR> mFile = "changepo.pdf"<BR> mMapFile = Server.MapPath(mFile) <BR> &#039; MapPath does not check existence of file<BR> IF objFSO.FileExists(mMapFile) = False Then<BR> Response.End <BR> Set objFSO = Nothing<BR> Set objBinFile = Nothing<BR> End If<BR> Set objFile = objFSO.GetFile(mMapFile)<BR><BR> mStream = objBinFile.BinFileRead(mMapFile)<BR> <BR> <BR> &#039; Specify a MIME type such as "text/html", "image/gif" or "application/msword"<BR> Response.Clear<BR> Response.contenttype = "application/pdf"<BR> Response.AddHeader "Content-Type", "application/pdf"<BR> Response.AddHeader "Content-Disposition", "inline;filename=changgfepo.pdf"<BR> <BR> Response.binarywrite mstream<BR><BR><BR> Set objFSO = Nothing<BR> Set objBinFile = Nothing<BR> &#039;Response.End<BR>%&#062;<BR><BR>VB CODE "clsASPBinFile"<BR><BR>Option Explicit<BR><BR><BR>Function BinFileRead(ByVal inFileSpec As String) As Variant<BR> On Error GoTo errHandler<BR> Dim mHandle<BR> Dim lngFileLen As Long<BR> Dim arrData() As Byte<BR> <BR> mHandle = FreeFile<BR> Open inFileSpec For Binary Access Read As #mHandle<BR><BR> lngFileLen = FileLen(inFileSpec)<BR> ReDim arrData(lngFileLen)<BR><BR> Get #mHandle, , arrData<BR> Close #mHandle<BR> <BR> BinFileRead = arrData<BR> Exit Function<BR><BR>errHandler:<BR>End Function<BR><BR>Many thanks D<BR>