Solved

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

Posted on 2006-06-19
2
383 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
Comment Utility
0
 
LVL 2

Author Comment

by:MPDeveloper
Comment Utility
Just finished setting up the server.

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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Suggested Solutions

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now