Solved

adding records to a database using ftp on a web server

Posted on 2003-12-02
6
272 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

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 …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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