.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to move a file within ftp folders (C#)

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net

Hi all,

I want to move a file in FTP server from folder1 to folder2.. i am able to download the files from folder1 .After downloading, the file should be moved to folder2.. in other forums i got replies as.. downloading nd uploading to another folder... its not tht way..... my output shud be like... after downloading(I did the downloading part) folder1 shud be empty nd the file shud move to folder2..


Thnks guys



View Complete Post

More Related Resource Links

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Site File Structure, Folders, Learning project, subweb, web.config

I am just learning asp.net.  I purchased an "ASP.Net 3.5 web programming in C#" book, which I like allot.  I am on chapter 3 and want to complete a shopping cart exercise from the book.  I have to create several folders and files.  The exercise has the files and under the root directory and a few folders below that.  I already have a site that I've been learning on.  Can I create a subfolder on my site and put all the files in there?  Like the subfolder is the root of the project.   Here is list of Folders and files... Code/CartItem.cs Code/Product.cs Data/Cars.mdb Images/car.jpg Cart.aspx Order.aspx Web.config ................................ On my website I want to create a subfolder to keep alll the files in, as so... ShoppingCart/Code/CartItem.cs ShoppingCart/Code/Product.cs ShoppingCart/Data/Cars.mdb ShoppingCart/Images/car.jpg ShoppingCart/Cart.aspx ShoppingCart/Order.aspx ShoppingCart/Web.config ................................ Can I have two web.cong files?, one in the subfolder?  Or do I have to use the single, web.config file in the root directory of the site?  Are there any other pitfalls or trouble I might get into setting up my file structure like this?  Anything I should be aware of? Any thoughts or advice would be appreciated. Thanks, Mike   

How to move a file from one domain to another domain?

The following code works as it was originally designed to move a file from one directory to another directory on the same server, but I need to change it to work so it will move a file from one server to another server.  My challenge is how to define the source directory on a different server and check if file exists. Please help.Code behind:Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click         Dim sFile, source, target, link As String         sFile = FileUpload1.FileName         source = "r:\storage\uploaded" & sFile         target = "r:\storage\" & DepartmentList.SelectedValue & "\" & InstructorList.SelectedValue & "\" & CourseNameList.SelectedValue & "\" & sFile         link = "http://someserver.com/upload/" & DepartmentList.SelectedValue & "/" & InstructorList.SelectedValue & "/" & CourseNameList.SelectedValue & "/" & sFile           'Start SelectedValue is not empty         If Not (DepartmentList.SelectedValue = "" Or InstructorList.SelectedValue = "" Or CourseNameList.SelectedValue = "

How to move PrincipalPermissionAttribute from CS file to app.config?

I'm really struggling with the following scenario: I have a WCF service where the methods of the implementation of my service contract are decorated with one, or many, PrincipalPermission attribute(s). For instance: [PrincipalPermission(SecurityAction.Demand, Role = "Administrators")] [PrincipalPermission(SecurityAction.Demand, Role = "MyGroup_1")] public void DoSomething() { //Work done here } [PrincipalPermission(SecurityAction.Demand, Role = "Administrators")] public void DoSomethingElse() { //Work done here } So in this case, method DoSomething(), could be called by users either members of the "Administrators" group or the "MyGroup_1" group. And only Administrators should be allowed to make calls to DoSomethingElse(). My problem is I want to put this in the app.config file, but I can't find any way to do this. How can I "move" these decorations from my CS file to the app.config?  

Directory.Move leads to corrupted 'file'


Hello All,


I have earlier used Directory.Move to move one folder into an existing sub folder. The path I specified happened to have a slightly different case to the existing directory (temp vs Temp), and the result is two folders, one called temp the other Temp. Normally we can't do this through windows as it recognises the two folders to ultimately have the same name regardless of case. I expected the .NET class to handle in the same way.

I've deleted the original Temp folder, but this 'temp' directory still remains... it's recognised by Windows as a directory yet also reported as not existing! Whilst I could probably live with a redundant corrupt file somewhere on my disk it's really causing some problems with recursive functions that, like the rest of windows, get confused by the directory which exists but doesn't exist.

Has anybody had this same problem? Or rather, how can I fix this?


Running VS2008 on Win7.




Move folder from file share to local C:/ drive on same box



I need to copy a folder from a file share to my local C: drive. Is there an easy way to do this in SSIS, or do I have to write a DOS batch file and execute it from SSIS.

Any help would be appreciated


Dave SQL Developer

Move a file from a Document Library to a location on a server not in the SharePoint Farm

I have an excel file I need to move daily from it's location in a MOSS enterprise edition Farm, to a location on a SQL server not in the farm but in the same domain. Is there some method I can use using OOB SharePoint or OOB SharePoint w/SPD?

File move using File System Task


I want to move all files present one directory to another directory.

Both the directory Location stored in 2 variable say var1 and var2.

pls help

Cannot move file from one ftp directory to another in .NET Framework 4.0


I'm in the progress of updating my C++ code from visual studio 2005 to visual studio 2010.  I've come across a problem where the FtpWebRequest class is unable to move a file from one directory to another directory on a ftp server when an absolute FtpWebRequest::RenameTo path is specified.

For example, I want to move the file, file.txt from source to destination as follows:
source: /working/
destination: /data/

An example of the code I use to handle this is below:

    Uri^ target = gcnew Uri( gcnew String("FTP://servername//working/file.txt"));
    FtpWebRequest^ request = dynamic_cast<FtpWebRequest^>(WebRequest::Create( target ));
    request->Credentials = gcnew NetworkCredential( gcnew String("username"), gcnew String("password") );

    request->EnableSsl = (ftpType == ftpTypeFTPS) ? true : false;
    request->KeepAlive = false;
    request->Method = WebRequestMethods::Ftp::Rename;
    request->RenameTo = gcnew String("/data/file.txt");

The problem is that FtpWebRequest treats the FtpWeb

copy / move pdf file in documents library sharepoint 2010



I have a document library that contains many folders with different documents.

The library contains various content types.

When I try to copy or move a pdf document from folder to another  folder. the pdf document is copied, but without his meta-data.
 and the content type the file becomes to  default content type of system, to  "document."

Copying is done by explorer window
 (ie the documents library open the document library explorer Explorer And where we do copying or moving documents .)

It should be noted that when doing "copy to" or "move to" of documents and type Microsoft Office the meta- data yes  copied properly.

The problem applies only to the pdf files.

How do I make a copy or move of the pdf document with his meta-data  by explorer window?

Move solutions (.wsp) file from one server to other



We have like 20 solutions(.wsp) in our development server and we want ot move all of them to our test server. how can we do that

How to connect two machines for directory/file operation like copy/move etc in C#


Hi All-

I wants to write c# code for a file transfer tool. My basic requirment is that, copying directories/files or moving directories/files from one machine to another machine.

For that I am populating source machine drives, directories and files into a first tree view control.

Now I wants to connect to onther machine which will be a destination machine and populate the drives, directories and files into second treeview control to copy/move the directories from source machine.

To connect, I will provide IPAddress, Port number, user name and password of destination machine.

To accomplish this,

which type of connections could be used?

How many connections type are there?

If the two machines are same LAN/Network how to connect together?

What is client/server connection mode?

What type of transfer protocal could be used?

Please give all the details about this.

Thanks in advance

File Stream Folders / Files still in file system


Hi All,


I have dropped and re-created a table that contains filestream columns.  When I have done this I see that the original folders / files still exist out on the file system.  How is it that these will get removed since the orignal table(s) have been dropped and re-created?

Looks like the folders are always two levels deep.  What does each represent? I can see the actual files, but what do the parent / child folders represent?

I also see the F$log folder.




Same file name, different folders. Store in document library separately


When I set up a document library in SharePoint 2007 (with versioning), I want to upload files with the same file name, but in different folders. I want each of the the files to have it's own version history. The files must remain distinct, as they are entirely different files with their own context in a folder hierarch.

Can I do this? How?

You can probably tell I am brand new to using SharePoint.


Jon Jacobs This message was composed entirely from recycled electrons.

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend