[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Simple file transfer through vb

Posted on 2004-08-27
5
Medium Priority
?
196 Views
Last Modified: 2013-11-13
Hello,
  I'm attempting to write a program to operate on a remote client machine that will populate a .mdb file and then when finished upload that file to a server.  Once it's uploaded I want the program to initialize a program on the server to run on the uploaded file.  I really have no idea how to go about this, even a starting point would be greatly appreciated.  I have a vb program that will populate the .mdb file; so I really just need the file transfer part and the activation of the program on the server side. If you need more information let me know.  Thanks.
~pcjunky
0
Comment
Question by:pcjunky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 10

Expert Comment

by:anv
ID: 11919433
use winsock control and u'll have to use
FTP commands to connect to the server and upload the file..

check teh link below:

http://www.vbip.com/protocols/ftp/vb-ftp-client-library/tutorials/tutorial-06.asp
0
 
LVL 7

Expert Comment

by:_agj_
ID: 11919434
use winsock to create a simple server and client.

if u dont want to write much code, rather set up an ftp server.

and ftp it to the server.
0
 
LVL 10

Expert Comment

by:anv
ID: 11919457
0
 
LVL 76

Accepted Solution

by:
David Lee earned 1500 total points
ID: 11924174
Copying the file is trivial.  You can use FTP or if you don't have FTP capabilty, or don't want to use it, then you can copy the file the old fashioned way.  Something like:

    Dim objFSO As New FileSystemObject
    objFSO.CopyFile "Source", "Destination"
    Set objFSO = Nothing

Initializing the program on the server requires you to make a choice.  There are several possibilites for handling this.  One, as both anv and agj suggested, you could use the Winsock control.  This'll require that the program on the server be running all the time, listening for a message from the client program telling it to run.  To use this approach you'll need to add the Winsock control to both the client and sever programs.  The client will attempt a conenction to the server and, if successful, send it a message telling it to that there's a file to process.  Two, if you don't want to use Winsock to handle this, then you could accomplish the same thing by simply writing a text file to a certain folder.  The folder would act as a queue that the server would watch.  When it sees a file appear there it jumps into action.  The logic is essentially the same as the Winsock approach, but doesn't require using Winsock.  As with Winsock, this method will require that the server program be running all the time.  If you like this option, then here a program (http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=41816&lngWId=1) that demonstrates how to watch a folder.  Three, if you don't want to have a server-side program that's running all the time, then you could use PSExec (http://www.sysinternals.com/ntw2k/freeware/psexec.shtml) from SysInternals.  Using it you can launch the server-side process from the client machine.  The only requirement is that the client will need to have sufficient permissions to launch the server process.  Four, if the files don't need to be processed immediately, then you could use Windows Scheduler to schedule the server-side program to run once an hour, or every 30 minutes, or however often you feel is appropriate.  Each time it ran it'd look for databases that'd been uploaded since it's last run.  This makes for a very simple program.  Its only downside is that files won't be processed immediately.  Some of them will sit there for awhile.  Fundamentally it's a choice between how quickly files need to be processed and how complex a program you want to create.

Hope this helps.
0
 
LVL 10

Expert Comment

by:anv
ID: 12245903
hello pcjunky!!!

Did u check the posts or not...???

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question