Solved

Simple Stumper - File Transfer from PC to Server on Web

Posted on 2002-03-15
5
144 Views
Last Modified: 2010-05-02
This seems like it should be very simple, but I don't know how to do it.

I need to create a program that can run on a PC.  The PC is connected to the internet.  The program needs to grab a file off the PC (path/file name can be hard coded into the program), and FTP the file to a particular ftp server (again, the ftp server address can be hard coded).

The key requirement is that the end user needs to have this process appear totally seamless.  They click, the file gets transferred, and the user is returned to where they were so they can continue about their business.

How can I do this?
0
Comment
Question by:Danimal
5 Comments
 
LVL 18

Expert Comment

by:mdougan
ID: 6868730
It can be fairly simple of you go to the Project|Components menu and select the Microsoft Internet Transfer Control.

Put one on your form somewhere, set the protocol to FTP, set the URL and I think that there might even be a property for remote directory, if the IP address is not enough.

You might also have to fill in a user id and/or password in the control's properties.

Then, in your code, under the button, you'd have something like:

   Inet1.Execute "WWW.MYSITE.COM", _
   "SEND C:\MyDocuments\Send.txt SentDocs\Sent.txt"

Where SentDocs is a remote subdirectory on the website and sent.txt is the name of the file after it is transfered.
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6868731
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 20 total points
ID: 6868779
put an internet transfer control on form and do this:

Inet1.URL = "ftp://server"
Inet1.UserName = "<userName>"
Inet1.Password = "<password>"

'' note i don't know if this supports embedded spaces in file name
Inet1.Execute , "PUT fileSrc fileDest"

While Inet1.StillExecuting
    DoEvents
Wend

MsgBox "done"
0
 
LVL 1

Author Comment

by:Danimal
ID: 6868788
ok.....I'll start working with these....

one complication:  the ftp has to be over an ftps connection...with ssl

How do I add in that part?
0
 
LVL 1

Author Comment

by:Danimal
ID: 6868944
Great answer!!!  Worked perfect!

Thanks!

Pls note that there is another question now posted, as a followon to this one.  (posting it now...might be a minute)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now