views:

31

answers:

1

I have a file uploading and viewing page in ASP.Net 1.1 using VB. Now the page will be visible in intranet as well internet. Here in my case the intranet and internet servers are different. How can i save the uploaded file in the intranet server and view from there subsequently when the activity is done using the internet server?

A: 

I'd suggest that you have both instances of the application (intranet and internet) save their uploaded files to a common location. I'm going to assume, given that you're targeting .net 1.1 that you're probably looking for a solution/directions for IIS 6.0 or below, rather than the 7.x that comes with Vista/Server 2008.

You need to firstly decide where you're going to store the uploaded files, it could be on the Intranet server, the Internet server or a 3rd "filestore" server. Having done that, you can map that location to a commonly named Virtual Directory on each of your two web servers as follows:

  1. Start "Internet Information Services (IIS) Manager" (Start > Control Panel > Administrative Tools)
  2. Expand the "Web Sites" node and find the virtual directory for your application
  3. Right click on the virtual directory and choose "New" > "Virtual Directory..."
  4. In the wizard that appears, give the folder alias as something like SharedUploadFiles
  5. Specify the path in the next step as something like \\192.168.100.1\SharedUploadFilesStore (i.e. wherever you've chosen to store the files
  6. The next step will require security credentials. Set these as a username and password that has read/write access (as appropriate) to the share you've specified in step 5.
  7. In the "Virtual Directory Access Permissions" step set the permissions as appropriate, click Next and then Finish.

Your application will now be able to access files in that share as if they were part of your web servers file system. So, if you had a file located at \\192.168.100.1\SharedUploadFilesStore\sample.txt, you would then be able to access it through both:

http://internetdomain.name/MyWebAppName/SharedUploadFiles/sample.txt

and

http://intranet.mycompany.local/MyWebAppName/SharedUploadFiles/sample.txt

My knowledge of how to solve any issues you encounter whilst configuring this isn't that deep, and you'd probably get a better answer at http://www.serverfault.com/ as whilst your question is a programming one, the answer I've given isn't a programmatic solution (not that it always has to be! =)

Rob
Hi Rob thank you for your answer. I did what you said but while uploading I am getting the message "Could not find a part of the path \\ServerIP\Uploaded Files". There is one link http://www.velocityreviews.com/forums/t79952-file-upload-to-a-remote-share-not-working.html where it is saying something about "ASP.NET uses does not have network permissions by default". Please Help!
Arup Chaudhury
@Arup, I assume that the `ServerIP` part of `\\ServerIP\UploadedFiles` is a synonym for your actual IP address? Either way I'd suggest, having had a brief read of the forum post you linked to, that you try following the steps outlined there. =)
Rob