473,442 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Copy files in C#

hi,
Can anyone help me regarding Copying Folder from local system to http location, actualy The Sourcepath is something like: "d:\abc\xyz" and the Destination path is like: "http://123.456.789.10:8080/abc/def/ghi/klm"

thanks in Advance.
Nov 14 '08 #1
6 4538
MrMancunian
569 Expert 512MB
I'm not an expert on this, but it seems to me you have to use FTP (File Transfer Protocol) instead of HTTP...

Steven
Nov 14 '08 #2
r035198x
13,262 8TB
You'd have to do a bit of recursion to copy the directories.
As for the copy itself, you can check the System.IO.File.Copy method.
Nov 14 '08 #3
Curtis Rutland
3,256 Expert 2GB
You don't actually have to do the recursion any more, look into the overloads for DirectoryInfo.GetFiles.

As to the question, we're going to need more information. How would you currently move the files? You typically can't just move files to an HTTP location...do you have FTP access to that website?
Nov 14 '08 #4
r035198x
13,262 8TB
You don't actually have to do the recursion any more, look into the overloads for DirectoryInfo.GetFiles.

...
Perhaps it's the Friday that's slowing me down but after looking at those overloads I couldn't see how you would be able to preserve the original structure without using recursion.
Nov 14 '08 #5
Curtis Rutland
3,256 Expert 2GB
Perhaps it's the Friday that's slowing me down but after looking at those overloads I couldn't see how you would be able to preserve the original structure without using recursion.
Oh, well maintaining structure would be more difficult. But as each FileInfo object returned has a DirectoryInfo object that describes the dir that the file came from, it's definitely doable.
Nov 14 '08 #6
You don't actually have to do the recursion any more, look into the overloads for DirectoryInfo.GetFiles.

As to the question, we're going to need more information. How would you currently move the files? You typically can't just move files to an HTTP location...do you have FTP access to that website?
hi,
i have configured the Network as "http://123.456.789.10:8080/abc/def/" in my network places and whenever i clicked on that shared network it will open dialog asking for username and password, i have to enter UN and PW to proceed after that i can paste the files. this is how i am doing manualy.
i hope this is ok with you.
Nov 17 '08 #7

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

Similar topics

11
by: Mike | last post by:
I want to be able to copy a directory of files (all .HTM files) from a network drive to a local drive on the machine c:\HTMFiles , How can i do that? I tried File.Copy(source, dest) but i need...
6
by: Wayne Wengert | last post by:
I am using VSNET 2003 to build an ASP.NET/VB set of pages. There are currently about a dozen aspx pages. When I make even a minor change to one page I currently rebuild the solution, copy the...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
2
by: Steve Franks | last post by:
The Copy Web tool provided with VS.NET 2005 is very convenient. However every once in a while it seems to think the files on the remote server have changed, which they have not. Then when I use...
5
by: DraguVaso | last post by:
Hi, I'm looking for a way to Copy and Paste Files to the clipboard. I found a lot of articles to copy pieces of text and bitmaps etc, but nog whole files. Whay I need is like you have in...
8
by: luis molina Micasoft | last post by:
it seems that when i do file.copy the svchost.exe is hanged, i mean if i make 40 threads of file.copy , 40 copys of files at same time the system is going down and stop responding, this is when i'm...
1
by: dkmarni | last post by:
Hi, I am trying to do this perl script, but not able to complete it successfully. Here is the description what the script has to do.. Accept two and only two command line arguments. Again,...
13
by: jim | last post by:
Is there a way (using VB.Net or C#) to copy open or locked files? Thanks! jim
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
1
by: =?Utf-8?B?UmFkZW5rb19aZWM=?= | last post by:
I am using standard File.Copy(source,dest,true) method in C# and I have problem with copying large number of files. Here is my code: foreach (FileInfo file in files) {...
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
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
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
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...

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.