Solved

adding records to a database using ftp on a web server

Posted on 2003-12-02
6
269 Views
Last Modified: 2013-12-24
Hello all

I was wondering if there is any possible way of adding a record to a database on a web server at the click of a button.

My circumstances are these:

At the moment i am designing an intranet.

When the user add's a job to the intranet it shall then automatically update the database on the web server.

This means it will have to update 2 tables:

Intranet table
Web Server table

I would appreciate any help

Thanks
0
Comment
Question by:jturkington
6 Comments
 
LVL 4

Assisted Solution

by:mrmcfeely
mrmcfeely earned 100 total points
ID: 9859370
Some more information would be helpful... specifically...

What kind of network architecture are you working with?  Is there a firewall or some other barrier between your intranet server and the web server that would make and ODBC, OLE DB, or some other similar db connection impossible?

Also, what database platform are you using?
0
 

Assisted Solution

by:Stoke
Stoke earned 100 total points
ID: 9859724
If you’re uploading files to a directory via ftp, then <cfdirectory> can read and report on the contents of that directory.

You could set a scheduled task to check the directory. The results from <cfdirectory> can easily be added to a database.
0
 
LVL 11

Assisted Solution

by:hart
hart earned 200 total points
ID: 9864430
ok u could do something like ....

in the intranet update the table after a job is added.

and then query the table and get all the jobs and corresponding details from the table in a list

<cfquery name="qry_jobs" datasource="dsn name">
   select * ffrom jobs
</cfquery>

now write this to a file

<CFFILE ACTION="WRITE" FILE="c:\somewhere\jobdetails.cfm" OUTPUT="
   <cfset Lst_JobID = ""#ValueList(qry_jobs.jobID,'~')#"">
   <cfset Lst_JobDetail = ""#ValueList(qry_jobs.JobDetail,'~')#"">
   similarly other details

">


then write this code
<CFFTP CONNECTION="RemoteServer"
         USERNAME="anonymous"
         PASSWORD="userName@company.com"
         SERVER = "192.168.3.38"
         ACTION="Open"
         STOPONERROR="Yes">
<!--- in the place of the ip given put ur web servers ip address --->
<CFIF CFFTP.SUCCEEDED>
      <CFFTP
      ACTION = "putfile"
      CONNECTION = "Anand"
      LOCALFILE = "c:\somewhere\jobdetails.cfm"
      REMOTEFILE = "jobdetails.cfm"
<CFELSE>
      Error in connection
</CFIF>


PS: there should be a ftp connection created on the remote server.

for creating an ftp connection go to the IIS of the web server and add a ftp site
in the tab virtual directory
choose a directory on this computer..

and give the physical path to the folder where u will ftp the file created above..


and in the web server keep a scheduled file that will read this file and insert the data into the database..

Regards
Hart

0
Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

 
LVL 11

Accepted Solution

by:
hart earned 200 total points
ID: 9864459
oh a small chang in the above code
change this part
<CFIF CFFTP.SUCCEEDED>
    <CFFTP
      ACTION = "putfile"
     CONNECTION = "Anand"
      LOCALFILE = "c:\somewhere\jobdetails.cfm"
     REMOTEFILE = "jobdetails.cfm"

to

<CFIF CFFTP.SUCCEEDED>
    <CFFTP
      ACTION = "putfile"
     CONNECTION = "RemoteServer"
      LOCALFILE = "c:\somewhere\jobdetails.cfm"
     REMOTEFILE = "jobdetails.cfm"

Regards
Hart
0
 
LVL 1

Assisted Solution

by:phatnegLo
phatnegLo earned 100 total points
ID: 10318800
ic., correct me if i'm mis understand your case :
first add another datasource which connects to the other datbase and then just replicate the query and change the datasource : ) you don't have to upload it... but i recommended u to use MYSQL for your database! so that you'll not get much trouble!

gud day!
0
 
LVL 1

Expert Comment

by:phatnegLo
ID: 10318814
by the way if you tried it... you must first set an access to your IP address on ur intranet or wherever your localserver is! just read this > http://www.mysql.com/doc/en/Adding_users.html
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

11 Experts available now in Live!

Get 1:1 Help Now