473,396 Members | 1,971 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.

Problem in FTP a file

Hi,
Thing is that i have to create the directory as the path of the file of local server to the FTP server.
Eg.
Lets assume file is placed in "C:\program files\MS\Avi\Text.txt"
when we will FTP this file to the server then it should place like this by creating the folder as : <c>\<program files>\<MS>\<Avi> and in the last folder ie "Avi", there we have to store the file called Text.txt.
plz help me out regarding this.

I am able to ftp the file Text.txt to the server but not able to create the folders on the server as the path of the file.
Aug 22 '08 #1
6 872
Curtis Rutland
3,256 Expert 2GB
Have you tried using DirectoryInfo objects? They have a .Exists and .Create() members. You will need to have appropriate permissions.
Aug 22 '08 #2
Thanks for the reply. But I dont know the logic how to extract the path name and create sub directory on the server.
let us assume the path of the file is:
C;\Pm\Avi\kavi\text.txt

Then the text file should store like this:
C(Directory)-->Pm(SubDirectory)--->kavi(SubDirectory)----->text.txt

means the text file will store at the last sub directory.

plz help me out regarding this.
Aug 22 '08 #3
cloud255
427 Expert 256MB
This is string manipulation. You should use the String class i believe there is a string.LastIndexOf() method which will return the last index of a character within a string, use this on your "/" then everything before that index is the directory path.
Aug 22 '08 #4
Very Very thanks for your reply...
Can you plz give me an example to show a piece if code how it look like using lastindex operation.
Aug 22 '08 #5
cloud255
427 Expert 256MB
Very Very thanks for your reply...
Can you plz give me an example to show a piece if code how it look like using lastindex operation.
Your welcome, i could give you the code, but the rules at bytes.com state that i cannot do someone else's work, so if you try it and experience issues, you can post your code and i could help you with it.

Intillesense gives a pretty good explanation on the method.
Aug 22 '08 #6
okk....i will try first then get back to u if i will face any problem..
Aug 22 '08 #7

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

Similar topics

18
by: ZoombyWoof | last post by:
Hi. Im very new to php, and I have a problem here that I cant find the solution for. I have problems with session variables, I want some variables to maintain their value between different php...
3
by: Marin | last post by:
Hello, I'm using: Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4 MySQL 4.1.12 DocMan1.3RC1 (PHP based document manager) I'm having following problem: file uploads OK, but...
12
by: Xah Lee | last post by:
would anyone like to translate the following perl script to Python or Scheme (scsh)? the file takes a inpath, and report all html files in it above certain size. (counting inline images) also...
2
by: Phil396 | last post by:
I have a Windows service that use a FileSystemWatcher to scan incoming html for information. The process worked fine in a Windows Application and it also works fine in a Windows Service except...
4
by: jimdscudder | last post by:
I am using a file watcher to watch for files changing. My problem is: the string file info returned is all LOWER CASE. Below is the important part of the code? Any suggestions? using...
8
by: surendran.d | last post by:
hi, I am using gcc 3.4.4 for c++, i am getting the following warning if there is no new line at the EOF. Why this warning and i am not getting the warning in vc++ compiler. thanks, suri
1
by: Domac | last post by:
I need to read some configuration data from .ini file located at Application.StartupPath location . Here is code snippet : Public Declare Unicode Function GetPrivateProfileString Lib...
3
by: Hamayun Khan | last post by:
I have Two asp pages addfiles.asp insert.asp addfiles.asp is used to browse the files which i want to upload to server. in IE both the pages run and the files uploads ok. There is...
0
by: fantasticamir | last post by:
I have a simple program using a couple of classes and it compiled successfully but while it is linking I have the following problem: g++ -Wall -lcu -lglu ACL2MDD.o Link.o Rule.o reachability.o ...
3
by: Mir Mosharrof Hussain | last post by:
I am a PC user with very little technical knowledge. I will be very very thankful if you please go through my problem and give me a solution. Problem : File system was NTFS. OS was in...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.