Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

adding records to a database using ftp on a web server

Posted on 2003-12-02
6
Medium Priority
?
278 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 300 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 300 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 600 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
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
LVL 11

Accepted Solution

by:
hart earned 600 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 300 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

886 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