Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Automated Polling & FTP Transfer question

Posted on 2001-07-16
6
Medium Priority
?
663 Views
Last Modified: 2011-09-20
The exact requirement is listed below.I want VB code for this:

I am building a VB application which will look(Poll) in different FTP Server(Unix,Windows) as well as in the C:/Filein directory for incoming files.If a fileis avaialable the application will process the file, move it to a separate directory & FTP it back to Unix server for processing. FTP to Unix server is OK to me & I know it.Main part I am looking for is the polling in different FTP servers & whenever file comes process it & put it in a separate directory.Any help will be very much appreciated.

Thanks
Himachal
0
Comment
Question by:himachal
[X]
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
6 Comments
 
LVL 2

Expert Comment

by:TrueDrake
ID: 6286845
Hi,

Since YOU're building a VB application, let's see you code up to now!

Enjoy
0
 
LVL 1

Accepted Solution

by:
jdesharnais earned 800 total points
ID: 6289992
I'm think what you are asking is how do i check if a file exists.
I would connect with verbose mode off the use the ls command to find if a file exists.
Here is an example of using ls with verbose mode on then off.


ftp> ls config.sys
200 PORT command successful.
150 Opening ASCII mode data connection for config.sys.
config.sys
226 Transfer complete.
12 bytes received in 0.00 seconds (12000.00 Kbytes/sec)
ftp> ls config.syd
200 PORT command successful.
550 config.syd: error 2.
ftp> verbose
Verbose mode Off.
ftp> ls config.sys
config.sys
ftp> ls config.syd
config.syd: error 2.
ftp>
0
 
LVL 1

Author Comment

by:himachal
ID: 6290437
Thanks for all your help.I am looking for how I can poll in a particular directory(Unix or Windows) for a file.Also note that I have to process the file only when it's being transfered to that directory.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:jdesharnais
ID: 6290614
So what you are saying is that at every x time interval you want to check is the file exists, if it does get it, delete the original, process it, then put it back to a different directory

I have done a lot of ftp but never in vb.  Here are some commands I found in the msdn library.


FtpFindFirstFile Function

--------------------------------------------------------------------------------

Searches the specified directory of the given FTP session. File and directory entries are returned to the application in the WIN32_FIND_DATA structure.

Syntax

HINTERNET FtpFindFirstFile(
    IN HINTERNET hConnect,
    IN LPCTSTR lpszSearchFile,
    OUT LPWIN32_FIND_DATA lpFindFileData,
    IN DWORD dwFlags,
    IN DWORD_PTR dwContext
);


Return Value

Returns a valid handle for the request if the directory enumeration was started successfully, or returns NULL otherwise. To retrieve a specific error message, call GetLastError. If the function finds no matching files, GetLastError returns ERROR_NO_MORE_FILES.






FtpCommand Function

--------------------------------------------------------------------------------

Allows an application to send commands directly to an FTP server.

Syntax

BOOL FtpCommand(
    IN HINTERNET hConnect,
    IN BOOL fExpectResponse,
    IN DWORD dwFlags,
    IN LPCTSTR lpszCommand,
    IN DWORD_PTR dwContext,
    OUT HINTERNET *phFtpCommand
);


Return Value

Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.

Remarks

GetLastError can return ERROR_INTERNET_NO_DIRECT_ACCESS if the client application is offline. If one or more of the parameters are invalid, GetLastError will return ERROR_INVALID_PARAMETER.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7153475
Hi himachal,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept jdesharnais's comment(s) as an answer.

himachal, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7182130
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 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