Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET filepath
i am getting problem in file copying from one server to another server domain in ASP.NET.
 
server name 1 : testserver1
 
Domain name : test
 
server name 2 : testserver2
 
domain name : testnet.
 
see my code :
 
SourceFilePath = "\\testserver2\fileslst\Reports\New\" & lblRenameGrid.Text & ".pdf"
 
DestinationFilePath = Server.MapPath("~/") + Session("ENo") & "\" & lblGrid.Text & ".pdf"
 
File.Copy(SourceFilePath, DestinationFilePath)
 

 
Error:
 
In server , it shows error message as given below:
 
Microsoft JScript runtime error:
 
Sys.WebForms.PageRequestManagerServerErrorException:
 
The account used is a computer account. Use your global user account or local user account to access this server.
 
But, the same will work in localhost
 
how to solve the above error...?
Posted 11-Jun-13 22:09pm
gani77871.3K
Comments
code_madi at 12-Jun-13 3:30am
   
The account under which IIS is running, is it known across both domains? i.e. Can the account carrying out the copy operation authenticate across domains?
I think therein lies the problem. It works on localhost because you are not jumping across domains and the account copying the file from one location to another is known in both the source and target locations.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 299
2 BillWoodruff 174
3 /\jmot 170
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 12 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100