473,486 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FTP : Need code or method to Folder Exists or Not in ftp Server in c#

donilourdu
53 New Member
Hi,

I am Doni Agna Lourdu. I developeing a small Ftp server. I can able to upload file, Create folder to Ftp Server. I can also List directory details.

But I can able to tell Whether Folder Exsists or Not. So kindly tell me any code or idea for this.


with regards,
Doni
May 31 '07 #1
5 13959
SammyB
807 Recognized Expert Contributor
Hi,

I am Doni Agna Lourdu. I developeing a small Ftp server. I can able to upload file, Create folder to Ftp Server. I can also List directory details.

But I can able to tell Whether Folder Exsists or Not. So kindly tell me any code or idea for this.


with regards,
Doni
Just experiment. Doesn't responseText return an empty string if the folder does not exist?
May 31 '07 #2
sgotur
1 New Member
can you explain the process of creating a folder inside a FTP server?
Jan 15 '08 #3
Plater
7,872 Recognized Expert Expert
Are you writing an FTP Server, or an FTP Client?
As an FTP server, you are in charge of making the directories, and thus you could use Directory.Exists() or any other method you chose since you are creating the server.

If you are creating a client, it is the server's responsibility to handle if the directory exists or not and respond to you with success or failure.
Jan 15 '08 #4
donilourdu
53 New Member
Thank you for your reply.
I am using FTP Client. First I need to share some thing with you . Then only you can understand better.

I need to upload large no of files. But Inside that folder there is possibility of folder with folders. Also I am uploading files one by one. For these resons only I need code to check Folder avilable or not and File avilable or not.
Looking for favorable reply

With regards,
Doni

Are you writing an FTP Server, or an FTP Client?
As an FTP server, you are in charge of making the directories, and thus you could use Directory.Exists() or any other method you chose since you are creating the server.

If you are creating a client, it is the server's responsibility to handle if the directory exists or not and respond to you with success or failure.
Jan 18 '08 #5
donilourdu
53 New Member
We can create folder in FTP using

folder creation method.

FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + dirName));
reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory; reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();

ftpStream.Close();
response.Close();


can you explain the process of creating a folder inside a FTP server?
Jan 18 '08 #6

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

Similar topics

7
6777
by: middletree | last post by:
I'm on an Intranet, and our Intranet server is on the same domain as the users. I have one place where I wanted to create a clickable link which would take the user to the directory for that...
2
2905
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
2
2114
by: Mark | last post by:
I got this code from the Internet. Demo on the site works fine but downloaded version is not. I am a very new to .NET, I cannot figure this out, please help. Here is the code: ASPX code: <%@...
2
4418
by: Keith Kowalski | last post by:
I anm opening up a text file reading the lines of the file that refer to a tif image in that file, If the tif image does not exist I need it to send an email stating that the file doesn't exist...
1
2832
by: BobAchgill | last post by:
Is there a special method to find out if a folder exists? The File.exists method for some reason did not work for me to see a folder. So I thought maybe there is another way to see if a folder...
13
2827
by: David | last post by:
Hi all, I have a singleton ienumerable that collects data from a database. I have listed the code below. It has the usual methods of current, move and reset. I need to go to a certain position...
46
2481
by: Bruce W. Darby | last post by:
This will be my very first VB.Net application and it's pretty simple. But I've got a snag in my syntax somewhere. Was hoping that someone could point me in the right direction. The history: My...
3
4154
by: trint | last post by:
How can I do this with my c# code with my website(because the file is there, but the code doesn't return it)?: if(File.Exists(String.Format("~/images/categories/{0}", sFileName)) return...
4
6193
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
0
7099
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
6964
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
7175
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
7319
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
5430
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,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.