Hi
I'm programming an application in ASP.Net in which users can view DWF files
through their browser, but I have a problem. With the object tag everything
works fine, but since security on the drawings is of very high importance, I
don't want people to see where the DWF files are located on the webserver
(calling the source of the document reveals this). So I thought, just like I
send a PDF to the Response object, I can send DWF files too, but it doesn't
work. I even tried sending the file binary, but that didn't work neither. I
keep on getting the Unsupported file type error and the file is correct, I
checked it in debug mode, it starts with '(DWF ...'. Mime types have been
added to the webserver. Any help is appriciated.
Code (non-binary):
---------------------------
Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/x-dwf"
Response.WriteFile(myDWFFile)
Response.Flush()
Response.Close()
Code (binary):
---------------------
Dim myFileSize as Long
Dim myFileStream as FileStream
myFileStream = New FileStream(myDWFFile, FileMode.Open)
myFileSize = myFileStream.Length
Dim myBinaryDWFFile(CInt(myFileSize)) as Byte
myFileStream.Read(myBinaryDWFFile, 0, CInt(myFileSize))
myFileStream.Close()
Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/x-dwf"
Response.BinaryWrite(myBinaryDWFFile)
Response.Flush()
Response.Close()