Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2004, 11:09 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Move XML files from Windows to Website

Hi,

I wish to automate the process of moving XML files from the Windows addplication out to the web so they can be read by my web application.

How can this be done (without having to manually do it by FTP)

Thanks


Kerry O'Carroll
__________________
Kerry O\'Carroll
 
Old December 17th, 2004, 01:02 PM
Authorized User
 
Join Date: Jan 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to rathbird
Default

Kerry,

Please explain more about what you're trying to do. You can import files from the file system, but that takes action from the user. You can upload web docs to a db and have your web app read them. You can have a windows service that polls the file system on a daily basis to see if new files have been created and then posts these files to a web service. You can definitely move files around without FTP. Are the XML files located on a different machine than the web server? You will not only have to automate the move process, but you will need to make sure that your web application has permission to access the directory where the files are located.

So please give more information, and then readers can give you more specific answers.

 
Old December 17th, 2004, 08:13 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Robin,

Thanks for your help.

I have XML files created on a desktop computer by a user in an office running an application written in VB .NET. I want this user to be able to press a button, then the application will copy these XML files out to a remote web server.

This is how it is done at the moment from a DOS prompt:

FTP <ip address>
user name: xxxxxx
password: xxxxx

then once in the remote directory

put file1.xml
put file2.xml
put file3.xml

bye

Thanks for your help



Kerry O'Carroll
 
Old December 17th, 2004, 08:15 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I forgot to mention, even though it is easy to use FTP, I don't want the user to have to enter all those commands. I don't mind if they have to enter user ID and password, but nothing else.

Thanks

Kerry O'Carroll
 
Old December 20th, 2004, 05:21 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any ideas!!

Kerry O'Carroll
 
Old December 20th, 2004, 05:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

How about a little VBS script that is scheduled in Windows's Scheduled Tasks? VBS files can be written in VBScript, and look a lot like ASP pages. Inside the script you can execute the FTP commands through "DOS", or use a FTP component.

You can also embed a script inside a SQL Server DTS Package. The script basically comes down to the same thing, though.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Moody by Tricky (Track 9 from the album: Vulnerable) What's This?
 
Old December 20th, 2004, 06:16 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for your help.

Can all this run from a VB .Net Windows application??

I need to come to terms with all these ideas. I am new to VB .Net and don't know VB Script (yet!!) Can you point me in the right direction of where to start. As mention earlier, all I want to do is FTP three files out to the webserver.

Cheers


Kerry O'Carroll
 
Old December 20th, 2004, 06:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's an either / or solution. Either you use a VBS file with VBScript, or you use a VB.NET application (or something else entirely).

When you search Google (http://www.google.com/search?hl=en&q...+component+FTP) you'll find a bunch of FTP components some of which are free. Some are for classic ASP, others are for .NET. Even the classic ones can be used in .NET through Com Interop (sounds scary, but basically it comes down to browsing to a DLL file from within VS.NET)

Either way, I think you need to do some Googling and, consequently, some reading. I don't have any ready-made FTP code for .NET available, but there are plenty of tutorials available on the net.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Herzeleid by Rammstein (Track 9 from the album: Herzeleid) What's This?
 
Old December 20th, 2004, 06:44 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar, I will do some searching. It seems a bit more complicated than what I thought. I have done things similiar years ago using DOS .bat files getting data files from one machine to another using FTP running automatically.

I will start searching google.

Cheers


Kerry O'Carroll
 
Old December 20th, 2004, 06:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can still do that too, I think.

Write a simple batch file with the code you proposed earlier, and then run the file with something like

System.Diagnostics.Process.Start("YourFile.bat")

I think that should work too

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Sly by Massive Attack (Track 8 from the album: Protection) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedure to move files gbminnock SQL Server 2000 1 November 23rd, 2007 07:44 AM
excel rename and move files ahzeri Excel VBA 1 October 28th, 2007 09:27 PM
Files need to move different folder surendran PHP How-To 2 June 20th, 2006 10:27 PM
How to monitor Website Info from Windows Applicati Awsok VB.NET 0 March 4th, 2005 09:44 AM
How to monitor Website Info from Windows Applicati Awsok General .NET 0 March 3rd, 2005 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.