如何设置网页代码以接收/显示实时FTP数据? [英] How to set up web page code for receiving/displaying real-time FTP'd data?

查看:81
本文介绍了如何设置网页代码以接收/显示实时FTP数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个温度传感器,能够通过互联网上的FTP将温度数据发送到指定的IP地址。 我想弄清楚如何修改我用EW1构建/发布的当前网站中的一个页面,以显示通过互联网通过FTP接收的温度
数据,这将每两分钟更改一次。

I have a temperature sensor that is capable of sending temperature data via FTP over the internet to a designated IP address.  I want to figure out how to modify one of the pages in a current web site that I built/published with EW1 to display the temperature data being received via FTP over the internet, which will change every two minutes.

有人可以给我一些关于如何在EW中进行设置的提示/想法/示例代码吗?

Can anyone give me tips/ideas/example code on how to set this up in EW?

 

推荐答案

我建议您使用EW包含页面功能或标准SSI,如下例所示。 然而,它将取决于温度数据被保存为什么类型的文件,例如, HTML或TXT或其他文件 - 仅限有限的文件类型可以在浏览器中轻松显示
。 以下是在另一个文件中显示一个文件并刷新页面以显示新数据的基本方法。 

I suggest that you could to use the EW include page feature or standard SSI like the example below.  However it would depend on what type of file the temperature data is saved as e.g. HTML or TXT or other file - only limited file types can then display easily in a browser.  Below is a basic way of displaying one file within another and refreshing the page to display new data. 

有更新的方法可以执行此操作,例如使用服务器端脚本或AJAX或其他方法来执行此操作,但下面是最简单的方法。

There are newer methods to do this e.g. using a server side script or AJAX or something to do this, but below is the simplest method.

根据示例使用EW包含页面或SSI。 您必须指定文件的位置,即FTP的位置 - 它与网站本身位于同一Web服务器上,还是分开? 我不知道SSI是否可以在
以外的引用文件中使用它所包含的页面的当前网页 - 在这方面,您的主机可能存在限制。

Use EW include page or SSI as per example.  You would have to specify the location of the file, i.e. where it is FTP'd to - is it on the same web server as the site itself, or separate?  I don't know if SSI works with referencing files outside the current web for the page it is to be included - there may be restrictions in place by your host in that respect.

<!--#include virtual="../quote.txt" -->

or use the FP/EW include page method (you can insert the code directly or through the GUI) - the web-bot code is like this:

<!--webbot bot="include" U-include="includepage.htm" TAG="BODY" -->

http://en.wikipedia.org/wiki/Server_side_include

第二部分,你需要刷新页面,但当然,必须在新上传之后,每隔2 1/2分钟刷新一次。

The second part, you need to then refresh the page but of course, would have to be after the new upload so, make the refresh every 2 1/2 minutes.

使用元刷新,如下所示。 调整时间(内容= 600位)以满足您的要求 - 时间指定为秒。 所以600相当于10分钟(10 x 60秒= 600)。  '150'将在2.5分钟左右。

Use the meta refresh, demonstrated below.  Adjust the time (the content=600 bit) to suit your requirement - the time is specified as seconds.  So 600 is equivalent to 10 minutes (10 x 60 seconds = 600).  '150' would be around 2.5 minutes.

< meta http-equiv =" refresh" content =" 150">

http://en.wikipedia.org/wiki/Meta_refresh

 


这篇关于如何设置网页代码以接收/显示实时FTP数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆