473,471 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FTP renaming

16 New Member
Hi,
am gettin an error while renaming a folder in an FTP location. The error says,
'The remote server returned an error: (550) File unavailable (e.g., file not found, no access).' though i have given proper credentials and the proper file path.
Here's the code :

FtpWebRequest reqFTP = ((FtpWebRequest)(FtpWebRequest.Create(folderPath)) );
reqFTP.Method = WebRequestMethods.Ftp.Rename;
reqFTP.RenameTo = newName;
reqFTP.Credentials=new NetworkCredential(UserName, Password);

reqFTP.KeepAlive = false;
string result = "";
try
{
//Get the result, streaming to a string
using( FtpWebResponse response = ((FtpWebResponse)(reqFTP.GetResponse())))
{
long size = response.ContentLength;
using (Stream datastream = response.GetResponseStream())
{
using (StreamReader sr = new StreamReader(datastream))
{
result = sr.ReadToEnd();
sr.Close();
}
datastream.Close();
}
response.Close();
}
}
catch
{
return false;
}
return true;
May 22 '07 #1
2 6529
kenobewan
4,871 Recognized Expert Specialist
Check that you have referenced the folder correctly and that there are no permission problems.
May 22 '07 #2
pratsadhu
16 New Member
Yes, I have checked, there are no permission problems

Check that you have referenced the folder correctly and that there are no permission problems.
May 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: peter | last post by:
Hello all, Recently I've started to refactor my code ...(I'm using python 2.3.4) I tried to add extra functionality to old functions non-intrusively. When I used a construct, which involves...
5
by: Adam Barr | last post by:
I have a tag foo that I want to copy unchanged when it is a subtag of bar, so I have a template (x is the namespace for the document): <xsl:template match="x:bar/x:foo"> <xsl:copy>...
0
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
0
by: Andy | last post by:
Hello: I am using System.Web.Mail.MailMessage. Currently: when I am attaching a file to the object, I am renaming the file using the FileInfo.Copy method and attaching the new file to the...
2
by: cloudx | last post by:
Hi there, it is driving me crazy. Aftering renaming app.config the following code I always get null on myApp. It works if I keep the name app.config. Why? string myApp =...
1
by: Jason B | last post by:
Hello, I have been trying to figure out how to rename my IIS directories and still have the project be able to run through VS. I have renamed the directories listed in the csproj.webinfo file and...
2
by: Brett Romero | last post by:
What is the best way for renaming a project (including namespace) that also has its tree structure as the project name in VSS? This project (DLL) is referenced by a couple of other projects in...
8
by: BillCo | last post by:
I'm updating a legacy app with table naming that makes baby jesus cry. It's a bit of a spider web though... no telling when and where the tables will be called by name. So I wrote this for renaming...
2
by: Johnny Jörgensen | last post by:
Is there any way of renaming the properties of standard controls. I want to create a TextBox control inherited from a normal textbox control, but I want to use the property for something else....
3
by: Shepherd.Travis | last post by:
I'm attempting to rename a Windows 2003 Server machine that has DB2 9.1 Express with Fixpack 2 installed. After I rename the machine and reboot, I get an error: DB2 UDB: SQL1042C An unexpected...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.