CN114172896A - Processing method for front end receiving back end file stream - Google Patents
Processing method for front end receiving back end file stream Download PDFInfo
- Publication number
- CN114172896A CN114172896A CN202111493830.9A CN202111493830A CN114172896A CN 114172896 A CN114172896 A CN 114172896A CN 202111493830 A CN202111493830 A CN 202111493830A CN 114172896 A CN114172896 A CN 114172896A
- Authority
- CN
- China
- Prior art keywords
- file stream
- stream data
- file
- data
- interceptor
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 10
- 230000004044 response Effects 0.000 claims abstract description 4
- 238000000034 method Methods 0.000 claims description 11
- 238000004891 communication Methods 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
Abstract
The invention relates to the technical field of file transmission of a front end and a back end of a computer, in particular to a processing method for a front end to receive a back end file stream, wherein the front end requests content input, the back end returns file stream data to an interceptor of the front end, the file stream data is processed in the interceptor, if response.status in the interceptor is equal to 200, the file stream data returned by the back end can be used, the front end acquires the file stream data, the front end formats the data after acquiring the file stream data, basic information of the file stream data is acquired after the data is formatted, the basic information comprises a file name, a file format and the like, the front end creates an a label, the a label generates an href address, the front end executes downloading, the a label is released after the downloading is finished, and the file data acquisition is finished. Compared with the prior art, the processing method for the front end to receive the back end file stream has the advantages that the front end can capture and display the error report information of the back end, and the user experience is improved.
Description
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of front-end and back-end file transmission of computers, in particular to a processing method for receiving a back-end file stream by a front end.
[ background of the invention ]
The downloading of the front-end general file stream adopts a method of calling a browser window. However, both of the parameters are actually transmitted after the interface address, and cannot be used once the complex parameters need to be transmitted by the front end, and the two modes also do not support the processing of downloading error-reporting information by the back end, thereby seriously affecting the user experience and the function realization.
[ summary of the invention ]
In order to overcome the above problems, the present invention provides a method for processing a front-end receiving back-end file stream, which can effectively solve the above problems.
The invention provides a technical scheme for solving the technical problems, which comprises the following steps: a processing method for receiving a back-end file stream by a front end is provided, which comprises the following steps:
step S1, the front end requests the content input, the back end returns the file stream data to the axios interceptor of the front end, and the file stream data is processed in the axios interceptor;
status if 200, then the file stream data returned by the back end can be used, and the front end acquires the file stream data;
step S3, the front end formats the data after acquiring the file stream data;
step S4, after data formatting, obtaining basic information of file stream data, including file name, file format, etc.;
step S5, a label a is created at the front end, and the label a generates an href address;
and step S6, the front end carries out click () execution downloading, the a label is released after the downloading is finished, and the file data acquisition is finished.
Preferably, in step S1, the specific flow of the steps of processing the file stream data in the axios interceptor is as follows: the front end requests content input; intercepting a first request of file stream data; intercepting the second request of the file stream data; requesting to allocate file stream data; requesting to schedule file stream data; carrying out front-end and back-end communication by adopting an XMLHttpRequest communication method; the back end returns a result; returning a result to perform first interceptor interception; returning a result to perform second interception; and returning and outputting the result.
Preferably, in step S2, if the response in the axios interceptor is not equal to 200, it indicates that the back end reported an error, and the front end can capture the error and display the error to the user in a pop-up form.
Compared with the prior art, the processing method for the front end to receive the back end file stream has the advantages that the front end can capture and display the error report information of the back end, so that the user experience is improved; the front end can transmit complex parameters to the back end, so that the problem that the downloaded file stream cannot transmit the complex parameters is solved, and the functionality of the system is expanded.
[ description of the drawings ]
FIG. 1 is a flowchart illustrating steps of a method for receiving a back-end file stream at a front-end according to the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that all directional indications (such as up, down, left, right, front, and back … …) in the embodiments of the present invention are limited to relative positions on a given view, not absolute positions.
In addition, the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Referring to fig. 1, the process of file data transmission between the front end and the back end is as follows: the back end reads the file, generates the byte code of the file, and returns the byte code of the file to the front end in a data mode of the file stream, the web browser of the front end receives the file stream data returned by the back end, and the web browser automatically analyzes the file stream and automatically executes downloading. The invention relates to a processing method for receiving a back-end file stream by a front end, which comprises the following steps:
and step S1, the front end requests content input, the back end returns the file stream data to the axios interceptor of the front end, and the file stream data is processed in the axios interceptor.
In step S1, the specific process flow of the file stream data being processed in the axios interceptor is as follows: the front end requests content input; intercepting a first request of file stream data; intercepting the second request of the file stream data; requesting to allocate file stream data; requesting to schedule file stream data; carrying out front-end and back-end communication by adopting an XMLHttpRequest communication method; the back end returns a result; returning a result to perform first interceptor interception; returning a result to perform second interception; and returning and outputting the result.
Status if equal to 200 in the axios interceptor indicates that the file stream data returned by the back-end is available, the front-end acquires the file stream data, step S2.
In step S2, if the response is not equal to 200 in the axios interceptor, it indicates that the back-end reports an error, and the front-end can capture the error and gracefully present the error to the user in a pop-up form.
Step S3, the front end obtains the file stream data and formats the data.
Step S4, after the data is formatted, the basic information of the file stream data is obtained, including the file name, the file format, and the like.
In step S5, the front end creates an a-tag, which generates an href address.
And step S6, the front end carries out click () execution downloading, the a label is released after the downloading is finished, and the file data acquisition is finished.
The request participation of the file stream is the same as that of the common interface request method, and complex participation is supported, and the interface is not required to be requested by using a form, a window.
Compared with the prior art, the processing method for the front end to receive the back end file stream has the advantages that the front end can capture and display the error report information of the back end, so that the user experience is improved; the front end can transmit complex parameters to the back end, so that the problem that the downloaded file stream cannot transmit the complex parameters is solved, and the functionality of the system is expanded.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and any modifications, equivalents, improvements, etc. made within the spirit of the present invention should be included in the scope of the present invention.
Claims (3)
1. The processing method for receiving the back-end file stream by the front end is characterized by comprising the following steps:
step S1, the front end requests the content input, the back end returns the file stream data to the axios interceptor of the front end, and the file stream data is processed in the axios interceptor;
status if 200, then the file stream data returned by the back end can be used, and the front end acquires the file stream data;
step S3, the front end formats the data after acquiring the file stream data;
step S4, after data formatting, obtaining basic information of file stream data, including file name, file format, etc.;
step S5, a label a is created at the front end, and the label a generates an href address;
and step S6, the front end carries out click () execution downloading, the a label is released after the downloading is finished, and the file data acquisition is finished.
2. The method as claimed in claim 1, wherein in step S1, the specific steps of processing the file stream data in an axios interceptor include: the front end requests content input; intercepting a first request of file stream data; intercepting the second request of the file stream data; requesting to allocate file stream data; requesting to schedule file stream data; carrying out front-end and back-end communication by adopting an XMLHttpRequest communication method; the back end returns a result; returning a result to perform first interceptor interception; returning a result to perform second interception; and returning and outputting the result.
3. The method as claimed in claim 1, wherein in step S2, if the response.status in axios interceptor is not equal to 200, it indicates that the back end has reported an error, and the front end can capture the error and display the error to the user in a pop-window form.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111493830.9A CN114172896A (en) | 2021-12-08 | 2021-12-08 | Processing method for front end receiving back end file stream |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111493830.9A CN114172896A (en) | 2021-12-08 | 2021-12-08 | Processing method for front end receiving back end file stream |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114172896A true CN114172896A (en) | 2022-03-11 |
Family
ID=80484352
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111493830.9A Pending CN114172896A (en) | 2021-12-08 | 2021-12-08 | Processing method for front end receiving back end file stream |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114172896A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103647841A (en) * | 2013-12-19 | 2014-03-19 | 山东大学 | Method for analyzing and downloading network file address of thin client |
US20140359080A1 (en) * | 2013-05-30 | 2014-12-04 | Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. | File download method, system, and computing device |
CN110417912A (en) * | 2019-08-08 | 2019-11-05 | 成都九洲电子信息系统股份有限公司 | A kind of method that file download is adjusted back after the completion |
CN112015383A (en) * | 2019-05-28 | 2020-12-01 | 北京京东尚科信息技术有限公司 | Login method and device |
CN112965739A (en) * | 2021-02-08 | 2021-06-15 | 中国工商银行股份有限公司 | Front-end HTTP request processing method, device and system |
-
2021
- 2021-12-08 CN CN202111493830.9A patent/CN114172896A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140359080A1 (en) * | 2013-05-30 | 2014-12-04 | Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. | File download method, system, and computing device |
CN103647841A (en) * | 2013-12-19 | 2014-03-19 | 山东大学 | Method for analyzing and downloading network file address of thin client |
CN112015383A (en) * | 2019-05-28 | 2020-12-01 | 北京京东尚科信息技术有限公司 | Login method and device |
CN110417912A (en) * | 2019-08-08 | 2019-11-05 | 成都九洲电子信息系统股份有限公司 | A kind of method that file download is adjusted back after the completion |
CN112965739A (en) * | 2021-02-08 | 2021-06-15 | 中国工商银行股份有限公司 | Front-end HTTP request processing method, device and system |
Non-Patent Citations (1)
Title |
---|
JAREDWANG: "前端利用Blob对象创建指定文件并下载", Retrieved from the Internet <URL:https://segmentfault.com/a/1190000015026760> * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20100192071A1 (en) | Client program, terminal, method, server system and server program | |
US9141611B2 (en) | Aggregated web analytics request systems and methods | |
CN1650592B (en) | Servicing requests that are issued in a protocol other than the protocol expected by the service | |
US8549100B2 (en) | Technique for previously providing estimate of time required for processing | |
US8145653B2 (en) | Using schemas to generate application specific business objects for use in an integration broker | |
JP4906672B2 (en) | Web application process recording method and process recording apparatus | |
US20020184363A1 (en) | Techniques for server-controlled measurement of client-side performance | |
US20070226612A1 (en) | Server-side html customization based on style sheets and target device | |
US9304833B2 (en) | System and method of providing inter-application communications | |
EP1576501A2 (en) | System and method for browsing on behalf of others | |
CN112187558B (en) | Data verification method and device and electronic equipment | |
CN107104999B (en) | Method and device for processing service interface call request | |
CN111209202A (en) | Terminal application testing method and device | |
US20120296958A1 (en) | Information processing apparatus, information processing system, information processing method, and program | |
CN113872967A (en) | Vehicle information transmission method and device, electronic equipment and storage medium | |
US20060005066A1 (en) | Mechanism for improving accessibility of JMX monitoring information in web content | |
CN114172896A (en) | Processing method for front end receiving back end file stream | |
US8959209B1 (en) | Systems and methods to indicate compatibility | |
CN110489326B (en) | IDS-based HTTPAPI debugging method device, medium and equipment | |
US20100257231A1 (en) | Method and system of providing active web user interface | |
EP2017750A1 (en) | Display control apparatus, display control program and display control method | |
CN115561620A (en) | Chip testing method and device based on GRPC (glass-fiber reinforced polycarbonate) and storage medium | |
CN113076343A (en) | Data query method, device, equipment and storage medium | |
JP4298284B2 (en) | Update notification apparatus and method, program, and storage medium | |
EP1100022A1 (en) | Method, system and program for specifying content displayed on browser |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |