Solved

Web Form File Access with a Secured Network Drive

Posted on 2004-04-16
6
263 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 500 total points
ID: 10870604
My first take on this would be to use Impersonation in the web.config file.

Bob
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 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