Solved

adding records to a database using ftp on a web server

Posted on 2003-12-02
6
271 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.htaccess rewrite url with querystring problem 13 94
AWS Advice on using WHM/cPanel 1 76
site launch date and last modified date 3 93
WEB Farm 6 70
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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