Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Simple file transfer through vb

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
pcjunky
Asked:
pcjunky
  • 3
1 Solution
 
anvCommented:
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
 
_agj_Commented:
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
 
anvCommented:
0
 
David LeeCommented:
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
 
anvCommented:
hello pcjunky!!!

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

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now