CN103049541A - Local file reading method based on browser - Google Patents

Local file reading method based on browser Download PDF

Info

Publication number
CN103049541A
CN103049541A CN2012105760327A CN201210576032A CN103049541A CN 103049541 A CN103049541 A CN 103049541A CN 2012105760327 A CN2012105760327 A CN 2012105760327A CN 201210576032 A CN201210576032 A CN 201210576032A CN 103049541 A CN103049541 A CN 103049541A
Authority
CN
China
Prior art keywords
browser
local file
local
method based
webpage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105760327A
Other languages
Chinese (zh)
Other versions
CN103049541B (en
Inventor
袁娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Jiuzhou Investment Holding Group Co.,Ltd.
Original Assignee
Sichuan Jiuzhou Electric Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Jiuzhou Electric Group Co Ltd filed Critical Sichuan Jiuzhou Electric Group Co Ltd
Priority to CN201210576032.7A priority Critical patent/CN103049541B/en
Publication of CN103049541A publication Critical patent/CN103049541A/en
Application granted granted Critical
Publication of CN103049541B publication Critical patent/CN103049541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a local file reading method based on a browser. The reading method includes the steps of firstly reading local file data information through a C interface in common gateway interfaces; secondly, analyzing local file data information and generating a static webpage; and thirdly, by the browser, analyzing and displaying the webpage. UI (user interface) design is simplified, realization of specific functional points is accelerated, and smooth switching between online and local playing interfaces is simpler. File searching, file sorting and page turning during specific operations can be achieved through javascript, multiple read of local data is avoided, and user operation experience is improved.

Description

A kind of local file read method based on browser
Technical field
The present invention relates to field of set-top, especially relate to a kind of local file read method based on browser.
Background technology
Along with the user is more and more higher to the application requirements of IPTV network machine top box, realize the picture browsing on the External memory equipment, audio frequency and video broadcast are also become one of its essential function.In view of existing set-top box is all carried out alternately platform EPG, Play Control by browser, the system of set-top box arranged etc. also finished by the page, therefore can take over seamlessly for making between the set-top box interface, and reach preferably visual effect, the preferential selection finished reading local file by webpage.
Summary of the invention
The object of the invention is to: for the problem of prior art existence, the design of a kind of UI of simplification is provided, accelerate the realization of concrete function point, and IPTV and local file is managed and the interface such as broadcast between take over seamlessly also simpler local file read method based on browser.
Goal of the invention of the present invention is achieved through the following technical solutions:
A kind of local file read method based on browser is characterized in that, this read method may further comprise the steps:
(1) in CGI (Common gateway interface), passes through C interface read local file data information;
(2) the local file data message is resolved and is generated the webpage of a static state;
(3) be responsible for resolving this webpage by browser, and show.
Preferably, the local file data message described in the step (1) is file name information and the folder information that is stored in the local file on the local storage.
Preferably, described local storage is local USB flash disk.
Preferably, described step (2) is, the local file data message resolved, and exist in the chained list that browser creates, and browser extracts again needs the fileinfo that shows, is filled among javascript script and the html, generates the webpage of a static state.
Compared with prior art, advantage of the present invention:
1, can simplify the design of UI based on browser, accelerate the realization of concrete function point, and IPTV and local file is managed and the interface such as broadcast between take over seamlessly also simpler;
2, the ff that runs in concrete operations, file ordering and page-turning function all realize by javascript, so just avoids repeatedly the reading of local data accelerated user's operating experience.
Description of drawings
Fig. 1 is method flow schematic diagram of the present invention.
Embodiment
The present invention is described in detail below in conjunction with the drawings and specific embodiments.
Embodiment
As shown in Figure 1, the present invention is a kind of local file read method based on browser, the method can be used for set-top box etc. need to carry out the equipment that local file reads, the implementation that adopts CGI+JavaScript+Html to combine, and this read method may further comprise the steps:
Step 1: in CGI (Common gateway interface) (Common Gateway Interface, CGI), pass through C interface read local file data information.
By calling the ioctl interface, and then call C interface in CGI, obtain file data information by C interface, file data information is each file, file and sub-directory file thereof, the folder information on the local USB flash disk.
Step 2: the webpage of the local file data message being resolved and generated a static state.
The html page of the webpage of the static state that this step generates for dynamically generating by CGI is specially: will the local file data message that read be resolved by the ioctl interface, and exist in the chained list that browser creates.Browser extracts the fileinfo that needs demonstration again, be filled among javascript script and the html, generate the webpage of a static state: a CGI scripting can be understood as an executable c program, by the fprintf function javascript and html code is generated a concrete webpage in program.The code sample of padding data is as follows:
[code]
fprintf(cgiOut, "<script language=\"javascript\">
function File(name, isdir, size) {
This.fname=name; // filename
This.isdir=isdir; // catalogue sign
This.size=size; // file size
This.time=" unknown "; // document creation the time
this.selected = \"false\";
}
");
fprintf(cgiOut, "</script>\n");
[/code]
This code sample will generate a javascript function in webpage, the function of this function will be carried out when browser resolves.In like manner, the mode of generation html content is also similar, as follows:
[code]
fprintf(cgiOut, "<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title〉the no title document</title 〉
</head>
\n\
<body background='images/bg.jpg'>
<table width='480' border='0'>
<tr>
<td><span id='filelist_fname0'>&nbsp;</span></td>
</tr>
</table>
</body>
</html> \n");
[/code]
Like this, the webpage that generates by the CGI mode just comprises the content of local data, and accurately, all data are included in the javascript script, and the process of concrete operations data all realizes by javascript, as: the page turning of data, data search with the deletion of data etc.
Step 3: be responsible for resolving this webpage by browser, and show.
The web storage that generates is in web server, and web server is the thttpd server on the set-top box; When needs showed, browser was transferred webpage and is resolved and show, browser is the ipanel on the set-top box.
This method also can increase following steps in addition: increase document management module in Web server, realize the web data that generates is carried out data sorting, data search and data deletion management.The below will make an explanation for three major function points that relate in the document management module, and these modules all are by the CGI dynamic generation web page, then show to finish in browser.
Data sorting
To the ordering of data, can operate with the built-in sort function of javascript array object.
Data search
Because data all are kept in the string of javascript, so can use the built-in function of javascript string: indexOf () to searching of data.
As: string .indexOf (" Chinese "), if there is not the character of searching in this character string, this calls and will return-1 so.
The data deletion
Need to carry out two steps to the deletion of data:
The first step: by the local C interface deleted file of the ioctl interface interchange of js expansion;
Second step: by the clauses and subclauses in the deletion of the splice function in the javascript array object array;
The 3rd step: the data that refresh current page.
The above only is preferred embodiment of the present invention, not in order to limit the present invention, should be pointed out that all any modifications of doing within the spirit and principles in the present invention, is equal to replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (4)

1. the local file read method based on browser is characterized in that, this read method may further comprise the steps:
(1) in CGI (Common gateway interface), passes through C interface read local file data information;
(2) the local file data message is resolved and is generated the webpage of a static state;
(3) be responsible for resolving this webpage by browser, and show.
2. a kind of local file read method based on browser according to claim 1 is characterized in that, the local file data message described in the step (1) is file name information and the folder information that is stored in the local file on the local storage.
3. a kind of local file read method based on browser according to claim 2 is characterized in that, described local storage is local USB flash disk.
4. a kind of local file read method based on browser according to claim 1, it is characterized in that, described step (2) is, the local file data message is resolved, and exist in the chained list that browser creates, browser extracts the fileinfo that needs demonstration again, is filled among javascript script and the html, generates the webpage of a static state.
CN201210576032.7A 2012-12-27 2012-12-27 A kind of local file read method based on browser Active CN103049541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210576032.7A CN103049541B (en) 2012-12-27 2012-12-27 A kind of local file read method based on browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210576032.7A CN103049541B (en) 2012-12-27 2012-12-27 A kind of local file read method based on browser

Publications (2)

Publication Number Publication Date
CN103049541A true CN103049541A (en) 2013-04-17
CN103049541B CN103049541B (en) 2016-01-20

Family

ID=48062182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210576032.7A Active CN103049541B (en) 2012-12-27 2012-12-27 A kind of local file read method based on browser

Country Status (1)

Country Link
CN (1) CN103049541B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020376A (en) * 2007-07-13 2009-01-29 Euretechnos Co Ltd Portable terminal display system
CN101615194A (en) * 2009-07-16 2009-12-30 腾讯科技(深圳)有限公司 The generation method and system of dynamic web page
CN102164102A (en) * 2011-04-29 2011-08-24 中山大学 Embedded type home gateway web server system
CN102695095A (en) * 2012-05-28 2012-09-26 中山大学 Set-top-box-based USB multimedia automatic playing method and USB detection method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020376A (en) * 2007-07-13 2009-01-29 Euretechnos Co Ltd Portable terminal display system
CN101615194A (en) * 2009-07-16 2009-12-30 腾讯科技(深圳)有限公司 The generation method and system of dynamic web page
CN102164102A (en) * 2011-04-29 2011-08-24 中山大学 Embedded type home gateway web server system
CN102695095A (en) * 2012-05-28 2012-09-26 中山大学 Set-top-box-based USB multimedia automatic playing method and USB detection method

Also Published As

Publication number Publication date
CN103049541B (en) 2016-01-20

Similar Documents

Publication Publication Date Title
JP6748071B2 (en) Web content generation method and system
US20140006921A1 (en) Annotating digital documents using temporal and positional modes
CN108965397A (en) Cloud video editing method and device, editing equipment and storage medium
US20150120654A1 (en) Method, apparatus and terminal for processing documents
CN102752664B (en) Display method and device for text subtitle information in webpage
US20140325323A1 (en) Online video playing method and apparatus and computer readable medium
CN109683978B (en) Stream type layout interface rendering method and device and electronic equipment
CN105376502A (en) All media on-line editing tool
CN113099258A (en) Cloud director system, live broadcast processing method and device, and computer readable storage medium
CN102541452B (en) Multimedia input method, device and system based on mobile terminal
CN104516892A (en) Distribution method, system and terminal of user generated content associated with rich media information
WO2014176906A1 (en) Online video playing method and apparatus and computer readable medium
KR20120039921A (en) Method for providing search service and display apparatus applying the same
CN103517104A (en) Set top box and video captions composite method based on network broadcasting
EP2511816A1 (en) Method and apparatus for previewing application subject content
CN103618779A (en) Method and system for resource sharing
CN112329403A (en) Live broadcast document processing method and device
US20150281334A1 (en) Information processing terminal and information processing method
CN105740014A (en) Method for integrating YouTube functions in mobile terminal application
CN114679621A (en) Video display method and device and terminal equipment
CN105245959A (en) System and method for maintaining connection channel in multi-device linkage services
JP5792326B2 (en) Reading service providing method, content providing server and system
KR101173946B1 (en) Service method and sharing method of application in homenetwork system
CN102316367A (en) Method for storing video resource information
KR20140029837A (en) Method and apparatus for sharing java script object in webpage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210514

Address after: No. 6, Jiuhua Road, khuchuang Park, Mianyang, Sichuan

Patentee after: Sichuan Jiuzhou Investment Holding Group Co.,Ltd.

Address before: 621000 No.6, Jiuhua Road, Mianyang City, Sichuan Province

Patentee before: SICHUAN JIUZHOU ELECTRIC GROUP Co.,Ltd.