Solved

Simple Stumper - File Transfer from PC to Server on Web

Posted on 2002-03-15
5
143 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

12 Experts available now in Live!

Get 1:1 Help Now