Solved

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

Posted on 2006-06-19
2
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

734 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