Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-06-19
2
Medium Priority
?
393 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

971 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