?
Solved

Web Form File Access with a Secured Network Drive

Posted on 2004-04-16
6
Medium Priority
?
264 Views
Last Modified: 2010-04-24
I've created a VB.Net app that reads a csv file, does some processing, and then loads to a SQL Server DB.  The code works fine on our web server.  But, we would like to place the csv file on another secured network drive.  We can limit it to specific groups, and keep it off our web server.  

I've been using the following code:

Dim strFileName As String
strFileName = "V:\VMI\" + ddlPlantNum.SelectedItem.Value + txtCustNum.Text + ".csv"
Dim file As FileInfo = New FileInfo(strFileName)

File.CopyTo("V:\VMI\DTSLoad.CSV", True)

I've read some articles about using UNC instead of mapped drives, but both return the same error:

                    Could not find file "V:\VMI\121367.csv".  
                                             or
                    Could not find file "\\server\VMI\121367.csv".

Permissions are set as 'Full Access' for 'Everyone'.  I would like to restrict that in the future, but need to solve the current problem first.

Thanks for your help.
0
Comment
Question by:bwarneke
[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
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10846241
Where are you running the application from?

Bob
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 10857056
To copy a file:

Imports System
Imports System.IO



Public Module modmain

   Sub Main()
     Dim strFileName As String
    strFileName = "V:\VMI\" + ddlPlantNum.SelectedItem.Value + txtCustNum.Text + ".csv"
      File.Copy(strFileName , "V:\VMI\DTSLoad.CSV")
   End Sub
End Module
0
 

Author Comment

by:bwarneke
ID: 10863926
Thanks for the replies.  

Bob:  I'm running it from a web server that access another file server on the domain.

Dhaest:  That's essentially the code I'm now using.  I agree it works on a local drive, but not on a network drive.

Bill



0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1500 total points
ID: 10870604
My first take on this would be to use Impersonation in the web.config file.

Bob
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

752 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