473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Remote FileCopy using ASp.net

PRM
Hi
I have an ASp.net application using C#. I need to copy a file present on the web server machine to a remote machine on the network. Although this seems to be a trivial matter I am having difficulties copying the exe

I am Trying

string Source = @"c:\temp\test.exe"
string Destination = @"Z:\test.exe"

File.Copy(Source, Destination, true)

Z: is mapped to the Remote machine network drive. I am able to physically copy files to this drive from the Web Server machine, but when I try from ASp.net, I get the following erro

System.Io.Exception: Logon Failure: unknown user name or bad passwor

I think it has to do with the Web Server using the ASPNET user , which does not have the right credentials on the remote machine. I do not know how to solve this issue

I tried using WMI too, I was able to copy files from one directory to another directory on the remote machine, but not from the Web Server machine to Remote machine

Any help in this matter is appreciated

Regards
PR


Nov 22 '05 #1
1 2410
You're absolutely right. ASPNET is a local account, and the local ASPNET
account on one machine has very different credentials to the ASPNET account
on the other machine.

I'm not a sysadmin so I don't know whether granting rights on machine B to
\\A\ASPNET would help or not, but from a programmatic point of view other
options you could look into would be FTP, and of course Web Services.

--
--------------------------------------------------------
Peter Wright (www.petewright.org)
Author of ADO.NET Novice To Pro
From Apress. www.apress.com (and 10
other doorstops from Wrox)
"PRM" <an*******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Hi,
I have an ASp.net application using C#. I need to copy a file present on the web server machine to a remote machine on the network. Although this
seems to be a trivial matter I am having difficulties copying the exe.

I am Trying

string Source = @"c:\temp\test.exe";
string Destination = @"Z:\test.exe";

File.Copy(Source, Destination, true);

Z: is mapped to the Remote machine network drive. I am able to physically copy files to this drive from the Web Server machine, but when I
try from ASp.net, I get the following error
System.Io.Exception: Logon Failure: unknown user name or bad password

I think it has to do with the Web Server using the ASPNET user , which does not have the right credentials on the remote machine. I do not know
how to solve this issue.
I tried using WMI too, I was able to copy files from one directory to another directory on the remote machine, but not from the Web Server machine
to Remote machine.
Any help in this matter is appreciated.

Regards,
PRM


Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: deko | last post by:
In a multi-user environment, I have a table that stores hyperlinks to documents that are stored on the machine that hosts the mdb database. The table entry looks like this: ...
9
by: cantelow | last post by:
Hi. I've got a program printing multiple pdf reports, and I need to wait for completion of various associated operations- The pdf printer prints to one file, then I need to copy that where I need...
0
by: Perdo | last post by:
I still haven't seen any solution to or alternate for copying files to/from server drive using web form button server control The FileCopy() doesn't seem to work for me. There is Login error or...
3
by: Lou | last post by:
I have a file name witha wildcard: "D:\myFolder\Logo1.*tga" There are 50 files that match this wilcard. I want to copy these 50 files to another directory I Tried...
0
by: daniele.balducci | last post by:
Hi All, I'm experiencing troubles in a simple .net web application. The applicatione is made up by a single form looping to move some files to a different folder . the main loop is as follows...
3
by: betygs | last post by:
Hi all, I´m not speak english so well, but i'll try to do it better. I have a problem with the filecopy function when i use the IP instead of a computer name. For example This sentence works ok...
4
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
Where can I find XP version of FILECOPY.AVI, to use in a dialog? There is a movie called FILECOPY.AVI which is included with Visual Studio 2005, but it is the 16 bit (Windows 95) version. There...
7
by: bhughes2187 | last post by:
In my app I am creating, there is a procedure that does a file copy from the local drive to a network share. The issue I am having, is even though I have the share mapped, and I can browse to the...
7
by: TracyWants2Know | last post by:
Access Version: 2002 SP3 OS: MS Windows XP Professional Code from Module: Dim txtFileNameBuES As String Dim txtFileNameBuESXP As String Dim txtPathNameBuTo As String ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.