Download File From seperate file server(file server dont have IIS)

May 30, 2012 at 6:18 AM


Is it posible to download the file from seperate file server which is without IIS.

Below example give you clear Idea

I have two servers :-

AppServer :  Silverlight Application is installed on this server.

FileServer : this is used to store files

now senario is i want to download File from FileServer through Silverlight Application which is installed on AppServer.

Hope you can understand the senario.

let me known how we can achive this?





May 30, 2012 at 2:51 PM

The simple answer is yes. In reality though your challenge is not with Silverlight or Interlink directly. The issue is IIS will not allow you to access a remote file share when using the TransmitFile method (which is what Interlink uses when you call SendFile due to it's performance benefits).

You basically have two options.

1. For larger files where you want to leverage the IIS TransmitFile method, you will have bring the file local fiirst, and then send the local file as normal, maybe implementing some kind of local cache to help ease the burden under heavy load.

2. For smaller files, you can open up a FileStream to the remote file directly, and stream the results back yourself using response.WriteBytes(). Be sure and look at the SendFile method from the source to ensure you populate the headers correctly.

Both options require your AppPool Identity to have permissions to access the remote share and related files.

Hope this answered your question.

Jul 22, 2012 at 7:02 PM
Edited Jul 22, 2012 at 7:04 PM

If you use some filesystem driver that maps the remote filesystem to the local one at the IIS server (instead of using a remote share), wouldn't TransmitFile work? (that is if IIS never knew it was a remote file)

e.g. there are some s/w mapping cloud storage to local storage, also Windows Server has support for remote Linux file systems too I think and not sure if it treats those as remote shares

Jul 23, 2012 at 7:12 PM

You're correct, if you can find a driver that does it and that IIS supports and it can handle the load of moving files remotely etc. and versioning then yes that would work.