Solved

Connection to remote file server to stream files through IIS problem.

Posted on 2006-06-19
2
385 Views
Last Modified: 2012-05-05
I am currently switching from IIS5 to IIS6 (Win2k -> Win2k3). I have an application that MUST have the files streamed from a internal protected server with a firewall between the two servers. This is a must due to contractual security agreements.

The firewall is properly set up, as well as the persistant route to the remote server. Through Explorer on the web server I have the ability to connect to the remote server, map drives, transfer files, etc... However, I cannot seem to get any access to the files when called through my ASP application.

This bit of code works wonderfully on our old server (IIS5) but I can't get it to work on the new one (IIS6).

Here is the code I am using.

**********BEGIN ASP CODE IN VBScript*********************

                sFullFileName = "\\192.168.#.#\Streaming\[filename].pdf"
                Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
                If objFSO.FileExists(sFullFileName) Then
                                    
                        Response.Expires = -10000
                        Response.ContentType = "application/pdf"
                        Response.AddHeader "Content-Type","application/pdf"
                        Response.AddHeader "Content-Disposition","inline;filename="&id&".pdf"
             
                        set m_objBinaryFile = server.CreateObject("BinaryFileStream.Object")
                        Response.BinaryWrite m_objBinaryFile.GetFileBytes(cstr(sFullFileName))
                        set m_objBinaryFile = nothing
            Else
                      response.Write("No report is available for this period.")
                  
            End If

**********END ASP CODE IN VBScript*********************

We use this code in other applications where the filename points to a location ON the server. (ex. { sFullFileName = "F:\PDF_Files\Streaming\[filename].pdf"}) and the code works as it should and finds all of the files.

The code fails at the .FileExists (can't find the file) when trying to open files from the remote server. Trying to open the file directly without this check returns a file not found error.

I do not believe it is a permission issue because I tested both the IUSR_ and IWAM_ along with the Network Services set with Admin priveleges, and that did not work either.

I feel this has to be an IIS issue because the code works in other applications and I CAN access the remote server from Explorer from the web server.

Summary-----
1. ASP code CANNOT access remote server
2. Explorer on web server CAN access remote server
3. Network Services with Admin rights CANNOT access remote server through code
4. Code works when pointed to files stored on web server.

Thanks in advance for your help!
0
Comment
Question by:MPDeveloper
2 Comments
 
LVL 10

Accepted Solution

by:
dnojcd earned 500 total points
ID: 16935590
0
 
LVL 2

Author Comment

by:MPDeveloper
ID: 16939812
Just finished setting up the server.

That worked wonderfully - thanks for your help and quick response!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IIS7 FTP default folder 8 98
DNN auto-updating it's core ? 2 43
IIS redirect 1 68
How do I write a redirect rule for this scenario? 2 24
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question