Login  
Search All Forums
Dart Home | PowerTCP FTP for ActiveX | Custom Development Reply | PowerTCP FTP for ActiveX Topics | Forums   
AuthorForum: PowerTCP FTP for ActiveX
Topic: foxpro and ftp controls
User84

Posts: 10
Member Since: 04/15/02
posted April 15, 2002 3:41 PM

I'm a foxpro developer for my own internal use only. I don't have the time to learn the ftp process, so i liked the sound of Dart's ftp tool. I figured i could just modify their sample foxpro client app a little and be done with it, but no such luck. Using the client app I made a directory and using the STOR command, uploaded a sample word doc to the dir. Then using their RETR command, downloaded the word doc into a local directory. File transfers went fine, but msword does not recognize the file that's been retrieved - can't open it. Tried it with a foxpro table and same thing - foxpro doesn't recognize the retrieved file as a foxpro table. What gives?
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 15, 2002 3:54 PM


Hi,
Was the Ftp.Type set to 1 (ftpImage)?
Thanks,
-ken

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 19, 2002 3:45 PM

I thought i did, but after hard-coding it in before the stor or retr command, it worked fine. However, the next step i need to conquer is to code multiple file transfers into a foxpro button. I've tried many things and can't seem to get the right syntax.
ThisForm.Ftp1.Object.MPut("C:\Csimain\offsite\01\o_*.*", "ftp://mculberson@tellcsi.com@ftp.tellcsi.com/files/tfiles/")
returns:
Reply: 200 PORT command successful.
Reply: 553 Could not determine cwdir: No such file or directory.

ThisForm.Ftp1.Object.MPut("C:\Csimain\offsite\01\o_*.*", "/files/tfiles/")
returns:
Reply: 200 PORT command successful.
Reply: 425 Can't build data connection: Connection refused.

Please help.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 19, 2002 4:04 PM


The 553 error is because the ftp://mculberson is not a valid file name.

The 425 error means that the Data connection was refused, try using Passive mode instead.

Hope this helps!

Tony Priest
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 19, 2002 5:40 PM

Ok, we're getting closer. Sending in passive mode took care of the error, however still not sending multiple files. for ex: Trying to upload 2 word docs: start.doc & start_temp.doc using this syntax:

ThisForm.Ftp1.Object.MPut("C:\a_test\*.doc", "/files/tfiles")

What i end up with on the server is only 1 doc start_temp.doc and its contents are actually what should be in the other doc, start.doc.

And using the following command:
ThisForm.Ftp1.Object.MPut("C:\a_test\*", "/files/tfiles")

Instead of uploading 5 files, (2).doc, (2).dbf and (1).txt, the server only has the .txt file. 

Any thoughts? thanks.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 22, 2002 10:12 AM


Hi,
I just used the code below to successfully store all the files from my local directory to an "MPut/Sub1" directory on the server.
-ken

thisForm.Ftp1.Object.Login (host, user, pass)
thisForm.Ftp1.Object.MPut("e:\Test\MPut\*", "MPut/Sub1")
thisForm.Ftp1.Object.Logout()

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 22, 2002 11:06 AM

Hi Ken - thanks for the syntax - except my results are unsuccessful. Instead of ending up with 5 files on the server, I ended up with only one: s2.txt. Watching your foxpro client screen, it appeared 5 files transferred, but it seems like each one keeps overwriting the one before. I know it's not a limitation of the ftp server or the account because I was able to transfer the same 5 files easily using a ws_ftp client. 
Here's the code I put in a command button on your client form:
thisForm.Ftp1.Object.MPut("C:\a_test\*", "files/tfiles")

Returned:
Reply: 200 Type set to I.
Reply: 227 Entering Passive Mode (207,155,252,9,195,85)
Reply: 150 Opening BINARY mode data connection for files/tfiles/s2.txt.
Reply: 226 Transfer complete.

All I want to do at this time is store a group of foxpro files on the server programmatically and retrieve the same group programmatically. That's it. Do you really not know what to do? Or are you just giving me bits and pieces and desiring me to read the manual for the rest? As I said at the beginning, I do not have the time to learn the whole ftp process. I own my company, I'm not a hacker, or a cracker, or a whacker, or whatever. I just want to take advantage of this technology in a limited way. Please help me.  Or take the software back. thanks alot.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 22, 2002 11:48 AM


Hi,
That is interesting. I used those three lines of code successfully on the four different servers I tried it with. This is not a bit or piece of an app, it is all the code I used.
I even created a "c:\a_test" local directory, and "files/tfiles" remote directory to store to, and it still worked without a problem.
Try getting the update to see if that helps:
http://www.dart.com/downloads/update.exe
Also, does it work if you just call Store multiple times, instead of using MPut?
If you need further help, I recommend considering one of our paid support options.
-ken

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 22, 2002 4:00 PM

I put the follwoing in a command button on your sample foxpro client:
thisForm.Ftp1.Object.store("C:\a_test\s2.txt", "files/tfiles")
or
thisForm.Ftp1.Object.store("C:\a_test\s2.txt", "files/tfiles/copys2.txt") Neither one worked.
Downloading the update had no effect.
What I need is some working sample code to use with your sample client. Either some code to add mGet & mPut to your existing command list or sample code using Store that I can use to loop thru all the files in the folder.
thanks
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 23, 2002 10:19 AM


Hi,
The sample is not really conducive to MPut because it is a non-blocking app. However, you should have no problems using the un-modified sample to do single Stores.
Which brings up another question - are you sure the Timeout value is greater than 0?
Thanks,
-ken

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 23, 2002 10:50 AM

Yes the timeout is > 0. I am aware I can use the sample for single stores, I believe I made that clear already. You didn't answer my other request. There is no WORKING sample of foxpro code for transferring multiple files. Do you know any? This is why I bought your software. Every other Active-X control I've purchased from Hallogram had WORKING samples of Foxpro code as advertised. So far all you've given me is generic code that doesn't work in your sample client, so, I will ask again. Can you give me some WORKING sample Foxpro code for transferring multiple files that I can integrate into your sample client? It's a simple question, really.
User84

Posts: 10
Member Since: 04/15/02
posted April 23, 2002 11:18 AM

It must be difficult for you to see my perspective, so let me try to explain where I'm coming from. As a business owner today, I have to have a hundred software applications. With all the other financial pressures of running a business, particularly in a down economy, I must find foxpro products and services that are quick, reliable solutions. And if the product is not user-friendly for me, I have to have access to good no cost support. Believe me, not every company has an IT staff and huge budget to work with. So far I've found Hallogram to offer products that meet my needs for quick, reliable solutions. Yours is not user-friendly for me and more importantly, you are not very user-friendly as a consultant. First of all, you offer no free phone support, so I'm forced into a slow process of e-mail type Q&A. That's fine if it works, but I'm not much closer to a solution now than when I started. I like your foxpro client, so I've been trying to hang in there with you long enough to get the foxpro code for sending multiple files. I have 20 teleworking employees that have to upload and download 15 files each twice per day. Do the math. Would you STOR them one at a time?
N/A posted April 23, 2002 12:13 PM


Hi,
Sorry, I incorrectly inferred from your previous post that you were not able to store a single file with the sample.
Below is working code in VFP. This code worked beautifully for me on multiple machines with multiple servers. Have you had a chance to try it?
Thanks,
-ken

thisForm.Ftp1.Object.Login (host, user, pass)
thisForm.Ftp1.Object.MPut("c:\a_test\*", "files/tfiles")
thisForm.Ftp1.Object.Logout()

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 23, 2002 1:33 PM

Many times, many ways. When I put that code, or any variation of that code in a command button on YOUR client app, I've gotten a variety of results, none of which transferred all my files in \a_test. All my attempts our on previous correspondence. If I have to repeat myself, this is going to take a lot longer. No offense, but can you escalate this to someone who can help me? Sorry to repeat myself, but buying your support package is not an option.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 23, 2002 1:58 PM


I think I can jump in here with some info. Probably what is happening is that your FTP server does not support Full Recursive Listings (LIST -R) and we are not getting the full results and therefore are not getting all the files.

The FTP tool's MPUT and MGET functions were added as a convenience and will only work on servers that support the LIST -R directory Listing style.

Have you tried using the Trace function to view the responses from the Server? Maybe there is some info in there that will aid you.

I gather that from your tone in this thread that you weren't expecting to spend a lot of time working on this. Well, sometimes that's the case and sometimes it isn't. This forum is meant to be used as a place to search for quick solutions to common problems.

In some cases, like this one, extra time will have to be spent walking the customer through the creation of their application. That is why we offer support packages.

If you find that your server does not support -R listings, then you will have to get the Listing yourself and Retrieve each file one at a time. I would really like to work one on one with you to resolve this issue, but unfortunately that is not going to happen here on the forum.

Tony Priest
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 23, 2002 2:36 PM

You're still avoiding the main question. What is the WORKING foxpro command to send multiple files to the server? If it's not MPUT, then how might I use STORE? I can create a looping procedure, I just need you to tell me what the command is to programmatically store 1 file at a time using a command button in your foxpro client app. It seems you're avoiding answering this simple question just to get me buy a support package! If you're so inclined to continue to avoid answering this basic question on the forum, then I'll be inclined to return your software to Hallogram with a full explanation of this ridiculous process you've put me thru. To make your job easier, I've taken the time to provide all kinds of feedback on what I need, yet you continue to rip off my time. You know this is the kind of thing you see on one of those joke tech support sites. You've avoided a simple question for, what, 15 correspondences now? If your support guys would just have answered the question the first time, it WOULD have been a simple, low cost transaction. For both of us, right? Answer the question and we're done, geez.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 23, 2002 3:07 PM


Hi Ron,
Please do not add the code to the existing sample app. As I mentioned earlier, the sample is non-blocking, and MPut can only be used in a blocking fashion. Using it in the sample will have unpredictable results.

Instead, please create a new project with a new form, and place the Ftp control and a button on the form.
In the button event place the three working lines of code I have previously posted (modified for your server and account). Run the project and click the button. The files should be stored on your server, as they were on every server I tried with this same project. If they are not, please add a line to change the Passive property to False, and try it again.

If, after you have created the project outlined above, you still experience problems, please call us, and we'll see what we can do.
Thanks,
-ken

K M Drake
Dart Tech Support
User84

Posts: 10
Member Since: 04/15/02
posted April 23, 2002 9:39 PM

Alright, I'll do what you suggested. I understand MPut won't work in a non-blocking app. But you still haven't said whether or not the STORE command will work in a loop routine on your sample app? Does the STORE command not work in a non-blocking app also?
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 24, 2002 9:28 AM


Hi,
As you have confirmed with the sample, Store does work in a non-blocking app. However, Store will not work in a loop in the sample. Programming in a non-blocking manner is different than blocking, in that you must wait for events to occur before proceeding with the next command. For example, if you were to just call Store within a loop, it would begin a Store, and then try to start another one before the first had finished.
In order to do successive stores in an asynchronous app, you would have to check the progress event for the completion of the current transfer (Status of 0) before starting the next.
-ken

K M Drake
Dart Tech Support
Reply | PowerTCP FTP for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX