Solved

adding records to a database using ftp on a web server

Posted on 2003-12-02
6
274 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
[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 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
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Restrict IIS Website without Windows login 7 64
IIS Site Configuration Copy 2 88
JVM encoding. How to change encoding. 27 130
Help with a redirect in web.config file 8 78
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
What You Need to Know when Searching for a Webhost Provider
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 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