473,396 Members | 1,865 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,396 software developers and data experts.

Make Directory on Ftp!

Hi All,

I am writing a code to make directory on ftp using c# and everything seems right.....But i am getting and error "The remote server returned an error: (550) File unavailable (e.g., file not found, no access)." and i don't know why. I am pasting the code here can anyone help????????

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net;
  6.  
  7. namespace makedirectory
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://127.0.0.1/" + "NewDirectory");
  14.             request.Credentials = new NetworkCredential("anonymous", "anonymous");
  15.             request.UsePassive = true;
  16.             request.UseBinary = true;
  17.             request.KeepAlive = false;
  18.             Console.WriteLine("Getting the response");
  19.  
  20.             request.Method = WebRequestMethods.Ftp.MakeDirectory;
  21.  
  22.             using (var resp = (FtpWebResponse)request.GetResponse())
  23.             {
  24.                 Console.WriteLine(resp.StatusCode);
  25.             }
  26.  
  27.         }
  28.  
  29.     }
  30. }
  31.  
Jan 14 '12 #1
0 1497

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

Similar topics

3
by: Chad | last post by:
Hello people. Im trying to make a directory using ms vc++ Ive been used to Borland and normally id do this.. #include <dir.h> void main() { mkdir("c:\\directory"); return 0;
1
by: EL1979 | last post by:
HELP!!!!! I am very frustrated and extremely confused. When creating the DB, it was split and userlevel security was enacted. Now, I need to make changes so that the VB code will look in the...
3
by: Greg Sabino Mullane | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A bad link in the ftp source directory inspired me to check the rest of it out: * Main README file needs updating. The URL is given as: ...
3
by: Arne | last post by:
Hello everybody! I am working on Windows XP and I want to do the following: 1. Connecting to a server using ftp 2. Getting the directory structure and the size of each directory in the root...
0
by: Thom Little | last post by:
The following will create a directory if one is specified (e.g., ftp://ftp.domain.com/one/) public void DirectoryMake(string strRemote, string strUsername, string strPassword ) {
2
by: Markus | last post by:
Hello Is it possible to determine the PHP path to the FTP base directory? ftp_pwd($conn_id) returns '/', while I need something like '/data/users/domain.com/'. I used a construct such as: ...
5
by: AlunDavies | last post by:
Hi, I'm working on a system that recurses through a given directory, ftp-ing all the contents up to our FTP server. I've got the recursion bit working fine, but whenever I try to upload a file I...
2
by: shyamsunderc | last post by:
I am using the following code but iam unable to connect to the IP address. I am unable to understand what is going wrong.... use Net::FTP; $ftp = Net::FTP->new('192.168.1.86') or die...
8
tharden3
by: tharden3 | last post by:
Hey all, had a question for you. I had volunteered to do some work in computers for my Engineering Academy's director. She asked that I build an FTP web site for a company in New York. Where do I...
5
by: idealfellow | last post by:
I have written ftp code which will download a single file from the Server using the below code: require 'rubygems' require 'net/ftp' require 'fileutils' URL = 'IP address' username = 'test'...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...

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.