Automating an upload of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need to regularly check an FTP folder for the presence of a file, and if
found, run a routine.

Given that this is all on our ISP's servers, what is the best way to
automate such a routine in ASP.NET?

The end target of the routine is likely to be a MySQL database. If we were
using SQL Server, I assume I could use DTS to trigger the process, but I'm
fairly ignorant of MySQL.

Thanks!
 
Doesn't look like a good task for asp.net. Asp.net is a technology for
building web pages in response to client requests. In your case, who needs a
web page? Who is the client for asp.net? What are the advantages of doing it
in asp.net as opposed to a regular windows scheduled task or a windows
service?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
I need to regularly check an FTP folder for the presence of a file, and if
found, run a routine.

Given that this is all on our ISP's servers, what is the best way to
automate such a routine in ASP.NET?

Well, any time you need to check for something on a regular basis and carry
out some processing based on the results of that check without user
intervention, a Windows service is almost always the right solution.
However, I'm assuming from the fact that you mention your ISP's servers,
that you're not able to deploy a Windows service on them...?

The "problem" with ASP.NET of course, in this particular instance, is that
your web app will stop when the last session terminates... This makes it
difficult to guarantee that your process will run 24/7. There are ways and
means to get round this, but these are hacks at best...

You mention that this regular check involves FTP - therefore, does it
actually need to be done through ASP.NET at all...? If you can access the
FTP site from outside your ASP.NET app, wouldn't it be easier to write a
Windows service and deploy it on another machine...?
The end target of the routine is likely to be a MySQL database. If we were
using SQL Server, I assume I could use DTS to trigger the process, but I'm
fairly ignorant of MySQL.

If your ISP supports MySQL v5.1.6 or later, you can simply create an event:
http://dev.mysql.com/tech-resources/articles/event-feature.html
 
asp isn't suited to such a task as asp code only runs when the page is
requested. Typically you'd use a service for this, or if you have control
over some other machine then that machine would run a scheduled task to
request a page on your web server that checks the folder.
 
I think what I really meant to say was, which of the technologies available
to me will help me automate this.

Looks like the MySQL events option, or a web service are the ways to go.

I'll have to find out if our ISP allows a web service.

Thanks to all for your speedy help!
 
Hi Adrian,

You can easily write a script (well, it needs 2 actually) to interrogate the
ftp folder, and upload the file to your local computer, and then run the
routine on it.

The first script fires an ftp session, the second script does the upload.

Once created, set a Scheduled Task to call it as often as you require.

I do this every night and then process the data locally with VB, but the app
can be of your choosing.

NEIL
 
Hi Adrian,

You can easily write a script (well, it needs 2 actually) to interrogate the
ftp folder, and upload the file to your local computer, and then run the
routine on it.

The first script fires an ftp session, the second script does the upload.

Once created, set a Scheduled Task to call it as often as you require.

I do this every night and then process the data locally with VB, but the app
can be of your choosing.

NEIL










- Show quoted text -

As I understand it, there is no need for any FTP actions. ASP.NET
needs to check if the file is in the local directory and if the file
is there, open it and import to the database. I'm right? So, if the
source file is small I don't see any problem to implement such
function - schedule aspx, depends on input format open the file and
make a connection to MySQL, import your data. That's all :-)
 
Back
Top