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
Solved

Simple Stumper - File Transfer from PC to Server on Web

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

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 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL VB connection works in one PC and doesn't in another 15 67
Error when passing an argument to a vb6 that contains  '/' 7 39
Child Form in front 4 49
Excel Automation VBA 19 88
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

809 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