Copy files/directories from a local machine to remote one

Hello!

I’m new in ASP.NET but I used ASP before.
I am looking for ways to copy files and/or directories from my local machine to another remote machine (say, into a shared folder assuming I know the machine IP address).
When copying all files from a directory and sub-directories, I should be able to pick only some of them (for instance, all files finishing in ".doc" and not exceeding 1 MB)
How can I do that in ASP.NET, normal ASP or VB Script?
It may be VB.NET since it seems to me that ASP.NET works with VB.NET whereas ASP didn’t use such things...
The only way I know to work with files was Scripting.FileSystemObject when I was programming in ASP or VB Script but I was wondering if there were new better ways since.
Thanks!
0
cfonblard
5/19/2004 3:37:29 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

4 Replies
962 Views

Similar Articles

[PageSpeed] 28
Get it on Google Play
Get it on Apple App Store

you need to look into the classes provided within the system.io namespace.  You will be able to do most of what you mentioned here with those classes.  One thing to note, though, you will have to configure the security settings to allow your machine to write to the share.
Sure don't know what i'm going for, but i'm gonna go for it for sure.
0
weaz_2001
5/19/2004 3:47:26 PM
Thanks! I'm having a look at system.io classes and it seems this is what I was looking for.

However, how should I configure the security settings to be able to write to the share?
0
cfonblard
5/24/2004 10:39:03 AM
if you put the copy process behind a web page, then it runs under the ASPNET account (or whatever account you configured for asp.net to use).  this mean that when you (on your account) can access the share, there is no guarantee that ASPNET (the webpage account) can access the same share.
Mike Banavige
~~~~~~~~~~~~

Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
0
mbanavige
5/24/2004 12:04:09 PM
What's the best way to perform the copy of my files/directories automatically (say, every night at a certain time)?

When I was programming in ASP, I would have written a VB Ssript (.vbs) and make it run every night using the Task Scheduler that comes with Windows.
Are there better ways to do such things in .NET (with ASP.NET, VB.NET, ....)?
0
cfonblard
5/24/2004 2:07:09 PM
Reply:

Similar Artilces:

Copying all files in a directory using either file.copy or directory.copy across volumes
I need to copy all the files from a cd directory to a directory on my harddrive. I have tried the directory.copy method but it will not allow me to copy across volumes. I have tried the file.copy method but you must specify a file name in the path as well as the target. This sort of defeats the purpose of what I am trying to do. Basically I am using a radio button to specify a type of CD and based on this selection the application knows what directory to look in for the files I want. Here is the script I tried last to move the file. Sub KPacs(ByVal sender As Object, ByVal e As System.EventA...

How can i copy file from one directory to another in vb.net?
Thank. Hi, use the File.Copy(sourcefile, destinationfilename) from the System.IO namespace. Taken from MSDN: Imports SystemImports System.IO Public Class Test    Public Shared Sub Main()        ' Specify the directories you want to manipulate.        Dim path As String = "c:\temp\MyTest.txt"        Dim path2 As String = path + "temp"         Try           ...

Copy a file from one machine to another machine
Edited by moderator XIII: Please read this article: How to post on forums Hai All, I need a Help. How to copy a file from One Machine to another Machine in the same Network using C#. Please Enlighten me.   Thanx, Karthik.A   Hi, use the System.IO.File.Copy() method. You can lay a network share to the other server so the destination address becomes accessible. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. But i need to do it without Share if it's possible thro! FTP . I need the code. ...

Copy files from one machine to another machine
--0-1622779252-1267620021=:77322 Content-Type: text/plain; charset=us-ascii Hi all, I need to copy files from one machine to another machine. I need to use Net::SCP module . Can you please give/help me small Perl snippet which will copy the files Please advice Regards Irfan. --0-1622779252-1267620021=:77322-- On Wed, Mar 3, 2010 at 8:40 PM, Irfan Sayed <irfan_sayed2002@yahoo.com> wrote: > Hi all, > > I need to copy files from one machine to another machine. I need to use Net::SCP module . > Can you please give/help me small Perl snippet whi...

.Net Application for Copying files from remoteserver to local machine on regular time interval.
Hi, How can I create one .Net application which will   Copying files from remoteserver to local machine on regular time interval.I spend a lot of time for searching  this in google.but I am not able to find the exact solution  . If any one having any idea regarding the same please let me know ..   Thanks In Advance Hari      Why use ASP.NET?  A scheduled batch file is easy and clean.  Use the Windows scheduler service. Your other option is writing a Windows service, which isn't ASP.NET. JeffPlease: Don't forget to click "M...

Identify file size of remote image on a image, without having to copy file to local file system
Hi I am builing some admin tools for a client and I am trying to identify the file size of an image via its URL (eg.  http://www.remotedomain.com/image.gif)  Is there a way of doing this without copying the image to the local file system and then manipulating the file locally to get its file size Many thanks inadvance Using a HttpWebRequest object, could you send a HEAD request and then use the ContentLength property of the corresponding WebResponse Thanks worked a treat, I used the following  Dim url As String = http://www.domain.com/image.gifDim obj_HTTPWebRequest A...

Copying more than one file using File::Copy
Good day=3B I apologize in advance if this is a very stupid question=85 I=27m trying to concatenate two files and have the results written to a = third file=2E = Maybe I=27m missing something obvious=2E=2E=2E but in Perldoc for File=3A= =3ACopy I = read=3A =22The copy function takes two parameters=3A a file to copy from = and = a file to copy to=2E=22 What can I do if I have a second file I want to copy from=3F (i=2Ee=2E Li= ke = DOS copy command=3A c=3A=5C file1=2Etxt + file2=2Etxt file3=2Etxt will co= py the = contents of file1=2Etxt =26 file2=2Etxt and put the...

VS 2005: How does one compare the code in a local file with the code in a remote file?
I have created an ASP.Net 2.0 website in VS 2005 Beta 2.  Is there any way I can compare the code in a local file with that in a file on a remote server or do I need to use a third-party program for this? Thanks, J.S. You will need a 3rd party program for this.Bill HiebertVisual Studio Web Tools...

Getting files from local directory
I want to get files from a directory on my drive C.When I run the code, it is trying to get the files from drive C on the server.How can I make the page to always take the files from the local directory?   mmhbk:I want to get files from a directory on my drive C.When I run the code, it is trying to get the files from drive C on the server.How can I make the page to always take the files from the local directory?   ASP.NET is a server side language, hence it is getting files locally from the web server hosting the asp web application.You must use client side technology to re...

Problem Copying a file from remote client using File.Copy
Hello, I have to copy a file that is uploaded from a remote client to Web Server into my application folder. I am using the following logic to achieve this. File.Copy(srcPath, destPath) Where srcPath = Path selected by the user using HTML File Input Control. and destPath = Server.MapPath(Excel_Upload) + "\Sample.xls" This works fine when I try uploading the file from the server system but when I try doing the same from a remote client, I get an exception which says "File.Copy Could not find a part of the path 'C:\Documents and Settings\Anas\Desktop\Sample12.xls'&...

Copy bin directory with files between machines.
I have a asp.net application that I compile on my dev machine. The same application runs on the dev machine as well as the live machine. I make changes to my app and then want the same changes on the live machine. The live machine is remote and I have remote desktop and ftp access to it. Can I just copy all the files (dll and pdb) from the bin directory on the dev machine to the bin directory on the live machine as well as the various aspx pages and aspx code behind pages (aspx.cs) for the live machine to reflect my machines changes? 1) Will this work? 2) Is it neccessary t...

Copying files in windows from one directory to the other
------=_Part_7841_20718407.1152726226112 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I got some files in $BNY_DOWNLOAD which is a directory in windows. Now i have to identify most recent one in that file and have to move it $BNY_DATA directory it is also a directory. To identify the most recent file I used sort command and sorted it by using -M and and space ship operators. It is returning list of files in that directory that are sorted by the last modification order. I'm getting that most recen...

How To Copy One Directory Files To Another?
How To Copy One Directory Files To Another? sarika Hi, the classes you need are to be found in the System.IO namespace. First you create the directory where you want to copy the files to. After that you iterate over all the files you wish to copy in the source directory. You can use File.Copy or FileInfo.CopyTo Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. Hello this could be a solution for your problem: string TargetPath = @"c:\Temp"; DirectoryInfo dir = new DirectoryInfo(Path); foreach(FileInfo file in dir.Ge...

copy directory from local machine to server?
how do i copy a directory from my machine to the server? the server says its unable to find the folder.. it is looking for the path on the server and not on my machine.. how do i resolve this? System.IO.DirectoryNotFoundException: Could not find a part of the path 'd:\photos'. Hi, Since the code is running on the Web Server, it will give you the path of the folders on the server only. You cannot copy a directory straightaway through code, you can use FileUpload controls to copy multiple files from client to server. HTH, VivekSocial Networking Platform in ASP.NET || Join now: CodeASP.NE...

Web resources about - Copy files/directories from a local machine to remote one - asp.net.getting-started

Avicenna Directories - Wikipedia, the free encyclopedia
Between 2000-2007, the WHO published the directory electronically, along with updates received after the 2000 print publication. In August 2007, ...

To Complement Its Search Engine, Facebook Launches People, Pages, and Places Directories
Facebook is now closer than ever to becoming the phone book for the internet. The site recently launched a Directory of people , Pages , and ...

Directories
The source for IT industry news, views and analysis across the channel, business and technology

Princess Diana leaked royal directories to Murdoch tabloid, court hears
The former royal editor of Rupert Murdoch's now defunct British tabloid the News of the World told a court on Thursday that the late Princess ...

Telstra slashes 800 jobs from directories arm Sensis
TELSTRA is slashing 800 jobs from its struggling directories arm Sensis just one month after the telco giant sold a 70 per cent stake in the ...

Government To Stop Publishing Contact Information In Blue Pages Of Phone Directories
... has decided to stop publishing contact information for all of its departments and agencies in the blue pages section of telephone directories.A ...

File System Programming Guide: Accessing Files and Directories
Explains how to create and manage files and directories.

Fixing directories
Web directories are one of the key points of differentiation between plans on the Exchanges. A single company can offer half a dozen networks ...

Welcome to SBJ Local Directories
... newsletters, events, print subscription, digital subscription or other special offers. Welcome to Sacramento Business Journal's local directories. ...

Bradenton and Lakewood Ranch Guides - Directories and guides
The Bradenton Herald is your source for Bradenton and Lakewood Ranch directories and guides.

Resources last updated: 1/22/2016 10:57:18 AM