473,549 Members | 5,156 Online
Bytes | Software Development & Data Engineering Community
+ 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 13964
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.Exist s() 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.Exist s() 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.C reate(new Uri("ftp://" + dirName));
reqFTP.Method = WebRequestMetho ds.Ftp.MakeDire ctory; reqFTP.UseBinar y = true;
reqFTP.Credenti als = new NetworkCredenti al(ftpUserID, ftpPassword);
FtpWebResponse response = (FtpWebResponse )reqFTP.GetResp onse();
Stream ftpStream = response.GetRes ponseStream();

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
6791
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 Ticket. So if you're on the page for Ticket 1000, the word "Files" is surrounded by this: <a href=\\servername\tickets\<%=strTicketid%>...
2
2919
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 where there is no scripts allowed running (the software is from Opentext called Livelink)- therefore I need javascript to do the tasks listed below:...
2
2122
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: <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %><%@ Page language="c#"...
2
4427
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 then skip this file and move onto the next file (line). If file is there then move to a sirectory. Here is the code I have (Feel free to make...
1
2834
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 exists. Bob
13
2833
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 or set filters or many other things and I don't know how to do this. I have just learned singleton AND ienumerable, so miraculously got this to...
46
2496
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 work involves creating custom packages of our software product for golf courses that purchase our software. The course data is kept as a back up in...
3
4160
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 String.Format("~/images/categories/{0}", sFileName); else if(File.Exists(String.Format("~/images/products/{0}", sFileName)) return...
4
6200
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 Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
0
7526
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7455
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7814
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5092
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3504
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
769
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.