Moving Files and Directories from one server to another server

This should work:
Dim FileToCopy as IO.File
FileToCopy.Copy("Sorce", "Destination")
 
Directory moving from one server to another server by using ASP.NET

csivaraj said:
Hi

How could we move the files from one server(\\server1\dirName\) to another server(\\server2\dirName\) in ASP.NET by using VB Language.

Dim FileToCopy as IO.File
FileToCopy.copy(source, destination) is not working

I want to move the Directories from one server to another server (not to copy)
Kindly provide me with the sample coding, if possible.
Kindly provide me with the sample coding, if possible.

many many thanks for your help


SivaraJ C

Dim FileToCopy as IO.File
FileToCopy.copy(source, destination) is not working

I want to move the Directories from one server to another server (not to copy)
Kindly provide me with the sample coding, if possible.
Kindly provide me with the sample coding, if possible.

many many thanks for your help
 
Sorry, for some reason I thought you wanted to copy...
This should work for moving a folder:
Dim FolderToMove as IO.Directory
FolderToMove.Move("Sorce", "Destination")
 
moving directories in ASP.NET from one server to another

TPM said:
Sorry, for some reason I thought you wanted to copy...
This should work for moving a folder:
Dim FolderToMove as IO.Directory
FolderToMove.Move("Sorce", "Destination")

The above command is not working when we move the files across the volumes or server.

Advice me

If you have sample coding, that would be handy

Sivaraj C
 
Is it giving you an error? (if so what is it)
You did change sorce and destination right?
 
moving directories in ASP.NET from one server to another

Hi

Yes,

Showing username and passwd error as you seen in my previous message.


Sivaraj C
 
moving directories in ASP.NET from one server to another

TPM said:
Sounds like a rights issue, not a program problem.

Kindly get me out from this problem

If you have sample code about the rights and permission or fileaccess

it would be realy worthy

Thanks for your help

Sivaraj C
 
Right click on the folder and goto the permissions tab and give full permission to aspnet
 
moving directories in ASP.NET from one server to another

TPM said:
Right click on the folder and goto the permissions tab and give full permission to aspnet

Hi

As Iam new to the ASP.NET, Kindly elobrate the below situation, which folder need to be given fill permission to aspnet.

And also when I deploy this as one the web page of existing system what kind of permission to given to the existing system.

Sivaraj C

 
The Folder your moveing will need full, and the folder you moving it too will need at least write.

I'm not quite sure what you mean by this, can you explain it a bit more.
And also when I deploy this as one the web page of existing system what kind of permission to given to the existing system.
 
I've just tried this code out at well and I'm getting the same errors as noted about. Stating the access is denied? Its a fresh new blank folder that I just want to copy from C:\Source to C:\Destination. And I get access to C:\Source is denied?

Is there a resource I need to add?

P.S. I'm running VB.net 2005.
 
More Info

I just wanted to provide more information to this problem.
Since, I'm experiencing the same issue and I am currently looking for a reasonable solution I stumbled into this forum.

Here is my scenario:

Web application is running on server "source"
I want to move an image on "source" to the server "destination"

IIS on Source has the anonymous user set to "FileMover"
"FileMover" has full control on the server "destination"

However when using FileInfo.CopyTo (or move) it gives permission denied errors as described in this post.

When looking at the logs on "destination" it shows an attempt to put a file from "source" as "ASPNet" (not "FileMover")

Permissions on "destination" can not be given to "ASPNet" from server "source"

Another solution is needed.

I'll post the work around I choose to use as an fyi, in the mean time if someone here has a better understanding of the problem and already knows of a work around - I'd be most interested.
 
Back
Top