CN106230919B - File uploading method and device - Google Patents

File uploading method and device Download PDF

Info

Publication number
CN106230919B
CN106230919B CN201610597685.1A CN201610597685A CN106230919B CN 106230919 B CN106230919 B CN 106230919B CN 201610597685 A CN201610597685 A CN 201610597685A CN 106230919 B CN106230919 B CN 106230919B
Authority
CN
China
Prior art keywords
uploading
file
target
page
upload
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.)
Active
Application number
CN201610597685.1A
Other languages
Chinese (zh)
Other versions
CN106230919A (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.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201610597685.1A priority Critical patent/CN106230919B/en
Publication of CN106230919A publication Critical patent/CN106230919A/en
Application granted granted Critical
Publication of CN106230919B publication Critical patent/CN106230919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network-specific arrangements or communication protocols supporting networked applications
    • H04L67/06Network-specific arrangements or communication protocols supporting networked applications adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Abstract

The invention discloses a method and a device for uploading files, and belongs to the technical field of computers. The method comprises the following steps: acquiring a storage address of a target file input by a user in a file uploading page; acquiring an uploading form template in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with form tags in advance; generating a target uploading form according to the uploading form template and the storage address of the target file; and sending the target file and the target uploading form to a server. By adopting the method and the device, the efficiency of compiling the uploading form can be improved.

Description

File uploading method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for uploading files.
Background
With the continuous development of network technology, people are gradually used to transmit files through a network. The user can open a corresponding file uploading page by using a browser on the terminal, and then the file is uploaded in the file uploading page.
In page codes of a file uploading page, each file uploading window corresponds to an uploading form, the uploading form is used for recording necessary data when a file is sent to a server, the uploading form can comprise form tags used for recording uploading addresses, coding rules, sending modes and the like of the file and input tags used for recording file addresses, and a programmer can create the uploading form firstly when compiling the page codes of the file uploading page and then fill in the form tags according to specific functions of the file uploading page. Then, in the process of uploading the file, the user selects the file, clicks the submit button, the browser can automatically fill the storage address and the file name of the file into the input label of the uploading form, and then uploads the file and the uploading form to the server, so that the server can acquire the file according to the uploading form and store the file.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
if a plurality of file uploading windows exist in one file uploading page, when a programmer writes page codes, an uploading form needs to be created for each file uploading window respectively, and form tags in each uploading form need to be filled in repeatedly, so that the efficiency of writing the uploading forms is low.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for uploading a file. The technical scheme is as follows:
in a first aspect, a method for uploading a file is provided, where the method includes:
acquiring a storage address of a target file input by a user in a file uploading page;
acquiring an upload form template in a page plug-in of the file upload page, wherein the upload form template is an upload form which is uniformly configured for all file upload windows in the file upload page and is pre-filled with form tags;
generating a target uploading form according to the uploading form template and the storage address of the target file;
and sending the target file and the target uploading form to a server.
Optionally, the generating a target upload form according to the upload form template and the storage address of the target file includes:
recording the storage address of the target file to an input tag in a page code of the file upload page, acquiring a DOM (Document Object Model) node of the input tag, moving the DOM node of the input tag to the upload form template, and generating a target upload form.
Optionally, the obtaining a storage address of a target file input by a user in a file upload page includes:
acquiring a storage address of a target file input in a first file uploading window in a file uploading page by a user;
recording the storage address of the target file to an input tag in a page code of the file upload page, acquiring a DOM node of the input tag, moving the DOM node of the input tag to the upload form template, and generating a target upload form, including:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
Therefore, when a plurality of file uploading windows exist in the file uploading page, the terminal can generate a target uploading form corresponding to each file uploading window according to the uploading form template.
Optionally, after generating the target upload form, the method further includes:
and acquiring a storage address of a new target file input in a first file uploading window in the file uploading page by a user, deleting the first target uploading form, and generating a new target uploading form according to the uploading form template and the storage address of the new target file.
The sending the target file and the target uploading form to a server comprises:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to a server.
Therefore, the user selects a new file to be uploaded, and the terminal can correspondingly generate a new uploading form.
Optionally, after the moving the DOM node of the input tag to the upload form template, the method further includes:
and in the page code of the file uploading page, creating an input tag at the DOM node of the input tag.
Therefore, a new iouput label is created at the DOM node of the original input label, and the user can conveniently perform related input in the corresponding file uploading window.
Optionally, the sending the target file and the target upload form to a server includes:
and when a submission instruction of the target file input by a user is received, sending the target file and the target uploading form to a server.
In a second aspect, an apparatus for uploading a file is provided, the apparatus comprising:
the first acquisition module is used for acquiring a storage address of a target file input by a user in a file uploading page;
the second acquisition module is used for acquiring an uploading form template from a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with form tags in advance;
the generating module is used for generating a target uploading form according to the uploading form template and the storage address of the target file;
and the sending module is used for sending the target file and the target uploading form to a server.
Optionally, the generating module is configured to:
recording the storage address of the target file to an input tag in a page code of the file uploading page, acquiring a Document Object Model (DOM) node of the input tag, moving the DOM node of the input tag to the uploading form template, and generating a target uploading form.
Optionally, the first obtaining module is configured to:
acquiring a storage address of a target file input in a first file uploading window in a file uploading page by a user;
the generation module is configured to:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting the first target uploading form after generating the target uploading form and acquiring the storage address of the new target file input by the user in a first file uploading window in the file uploading page, and generating the new target uploading form according to the uploading form template and the storage address of the new target file.
The sending module is configured to:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to a server.
Optionally, the apparatus further comprises:
and the creating module is used for creating the input tag at the DOM node of the input tag in the page code of the file upload page after the DOM node of the input tag is moved to the upload form template.
Optionally, the sending module is configured to:
and when a submission instruction of the target file input by a user is received, sending the target file and the target uploading form to a server.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a storage address of a target file input by a user in a file uploading page is obtained, an uploading form template is obtained in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with a form label in advance, a target uploading form is generated according to the uploading form template and the storage address of the target file, and the target file and the target uploading form are sent to a server. Therefore, when a plurality of file uploading windows exist in the file uploading page, the uploading form template can be adopted to generate a target uploading form for file uploading processing, and a programmer only needs to create one uploading form template and fill in a form tag in the uploading form template when compiling page codes, so that the efficiency of compiling the uploading form can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for uploading a file according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a file upload page provided in an embodiment of the present invention;
FIG. 3 is a simplified diagram of an upload form template according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a file uploading apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a file uploading apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a file uploading apparatus according to an embodiment of the present invention;
fig. 7 is a schematic device structure diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a file uploading method, and an execution main body of the method is a terminal. The terminal may be a terminal for uploading files, and may be a computer, a mobile phone, or the like. The terminal can be provided with a web browser, and the web browser can have functions of running page codes and displaying html pages. The terminal can be provided with a processor, a memory and a transceiver, wherein the processor can be used for detecting the related processing of the tone quality, the memory can be used for storing the data required and generated in the following processing process, and the transceiver is used for receiving and transmitting the corresponding data in the file uploading process. In this embodiment, the terminal is taken as a mobile phone as an example, and other situations are the same, and are not described in detail here.
The process flow shown in fig. 1 will be described in detail below with reference to specific embodiments, and the contents may be as follows:
step 101, acquiring a storage address of a target file input by a user in a file uploading page.
In implementation, a web browser for browsing a web page may be installed on the terminal, and a user may click to open the web browser, and then input a network address of a certain web page (i.e., a file upload page) in the website input window, and the terminal may send a page code acquisition request of the file upload web page to the corresponding server, and the server may send the page code to the terminal. After receiving the page code, the terminal may read the page code through the browser, and then display a corresponding file upload page, as shown in fig. 2. The file selection window can exist in the file uploading page, a user can click a file browsing key corresponding to the file selection window, at this time, the terminal can display a file selection interface, the user can select a file (namely a target file) to be uploaded in the file selection interface, and then click a confirmation key, the terminal can be triggered to acquire a storage address of the target file input in the file uploading page by the user.
Optionally, when there are multiple file upload windows in the file upload page, the processing of step 101 may be as follows: and acquiring a storage address of a target file input in a first file uploading window in a file uploading page by a user.
In implementation, after the terminal displays the file uploading page, the file uploading page may include a plurality of file uploading windows, the user may select to click a file browsing key corresponding to one file uploading window (i.e., the first file uploading window), the terminal may display a file selection interface, the user may select a file to be uploaded (i.e., a target file) in the file selection interface, and then click the confirmation key, the terminal may be triggered to acquire a storage address of the target file input by the user in the first file uploading window in the file uploading page.
And 102, acquiring an uploading form template in a page plug-in of a file uploading page.
The upload form template is an upload form pre-filled with form tags and uniformly configured for all file upload windows in a file upload page, a simple schematic diagram of the upload form template is given in fig. 3, and corresponding codes can be as follows:
<body>
<form action=″Handler2.ashx″method=″post″enctype=″multipart/form-data″name=″upload_form″></form>
</body>
in implementation, when the server sends the page code of the file upload page to the terminal, the server may also send a page plug-in corresponding to the file upload page. The terminal can obtain the uploading form template from the page plug-in of the file uploading page. The upload form template may be a js (java script, java description language) plug-in written in advance by a page code writer, and is an upload form configured uniformly for all file upload windows in a file upload page, and a form tag in the upload form template is completed by the writer in advance. In addition, the server does not need to send the page plug-in of the file uploading page, and the terminal can download the corresponding page plug-in from the server after acquiring the storage address of the target file, so that the uploading form template can be acquired.
And 103, generating a target uploading form according to the uploading form template and the storage address of the target file.
In implementation, after acquiring the storage addresses of the upload form template and the target file, the terminal can write the storage address of the target file into a corresponding position in the upload form template, so that a target upload form corresponding to the target file can be generated. It should be noted that the above processing processes are all processing of the terminal on the code side, the terminal can continuously display a file upload page, and when a target upload form is generated, the terminal can convert a target file into a data stream and add the data stream to the target upload form, that is, the target upload form contains data content of the target file.
Optionally, the target upload form may be generated by moving an input tag in the page code, and accordingly, the processing in step 103 may be as follows: recording the storage address of the target file to an input tag in a page code of a file uploading page, acquiring a Document Object Model (DOM) node of the input tag, moving the DOM node of the input tag to an uploading form template, and generating a target uploading form.
The DOM nodes may be nodes that locate elements in a document upload page in the form of a tree graph, each element corresponds to one DOM node, and it can be considered that the entire document upload page is a page node, each tag is an element node, and a text included in the tag is a text node, etc.
In implementation, after acquiring the storage address of the upload form template and the target file, the terminal may record the storage address of the target file into an input tag in a page code of a file upload page, then acquire a DOM node of the input tag, and move the DOM node of the input tag to a corresponding position in the upload form template, so that the target upload form may be generated. Here, the upload form template is an upload form in which the entire upload form has been filled in other parts except for the input tag, and thus, the DOM node of the input tag is moved to the DOM node of the input tag in the upload form template, and the DOM node of the input tag in the upload form template is deleted, so that the entire upload form (i.e., the target upload form) can be generated, and the corresponding codes can be as follows:
optionally, after the input tag is moved, in order to facilitate a subsequent user to perform a file selection operation in a corresponding file upload window, a new input tag may be created, and corresponding processing may be as follows: in page code of a file upload page, an input tag is created at a DOM node of the input tag.
In implementation, after the terminal moves the DOM node of the input tag to the upload form template, a new input tag may be created at a node position before the DOM node of the input tag, so that the user may input a storage address of a new target file in the file upload window.
Optionally, based on the situation that there are multiple file upload windows in the file upload page, the processing in step 103 may be as follows: recording the storage address of the target file into a page code of a file uploading page, acquiring a DOM node of a first input label by using the first input label corresponding to a first file uploading window, and moving the DOM node of the first input label to an uploading form template to generate a first target uploading form.
In implementation, after acquiring the storage address of the upload form template and the target file, the terminal may record the storage address of the target file into a page code of a file upload page, and then acquire a DOM node of a first input tag in the first input tag corresponding to the first file upload window, and move the DOM node of the first input tag to a corresponding position in the upload form template, so that a first target upload form may be generated. It should be noted that the first file upload window is any one file upload window in the file upload page, the user may input the storage addresses of the plurality of target files in the plurality of file upload windows in the file upload page, and the terminal may perform the above processing on each file upload window, that is, may generate the plurality of target upload forms.
Optionally, if the user re-inputs the storage address of a file in a certain file upload window, a new upload form may be generated, and the original upload form may be deleted, and the corresponding processing may be as follows: and acquiring a storage address of a new target file input in a first file uploading window in the file uploading page by a user, deleting the first target uploading form, and generating a new target uploading form according to the uploading form template and the storage address of the new target file.
In implementation, a user selects a target file in a certain file uploading window (a first file uploading window), after the terminal generates a corresponding uploading form, if the user wants to reselect the uploaded file, the user can click a file browsing key corresponding to the first file uploading window again, and then reselect a new target file in a popped file selection page, so that the terminal can acquire a storage address of the new target file input by the user in the first file uploading window, and then the terminal can delete the original uploading form (i.e., the first target uploading form), and then generate a new target uploading form according to an uploading form template and the storage address of the new target file.
And 104, sending the target file and the target uploading form to a server.
In implementation, after the terminal generates the target upload form, if the terminal does not add the data content of the target file to the target upload form in step 103, the terminal may convert the target file and the target upload form into a data stream and send the data stream to the server; if the terminal has added the data content of the target file to the target upload form in step 103, the terminal may directly convert the target upload form into a data stream and send the data stream to the server.
Optionally, after the user clicks the submit button, the target file and the target upload form may be sent to the server, and the corresponding processing in step 104 may be as follows: and when a submission instruction of the target file input by the user is received, sending the target file and the target uploading form to the server.
In implementation, after a user selects a target file in a file uploading window, the terminal can generate a corresponding target uploading form and store the target uploading form in a cache space, and after the user clicks a submission key in a file uploading page, the terminal can receive a submission instruction of the target file input by the user, so that the target file and the target uploading form can be sent to the server. It is worth mentioning that, if a plurality of file uploading windows are arranged in the file uploading page, and the user inputs the storage addresses of a plurality of target files in the file uploading windows, after the user clicks the submit button, the terminal can send the plurality of target files and the corresponding target uploading forms to the server together.
Optionally, based on the above-mentioned situation that the user reselects the target file, correspondingly, the processing of step 104 may be as follows: and when a submission instruction of the target file input by the user is received, sending the new target file and the new target uploading form to the server.
In implementation, the terminal may be configured not to send the target upload form to the server immediately after generating the target upload form, and only after the user clicks a submit button in the file upload page, the sending process is performed. That is, when the terminal receives a submission instruction of a new target file input by a user, the new target file and the new target upload form can be sent to the server.
In the embodiment of the invention, a storage address of a target file input by a user in a file uploading page is obtained, an uploading form template is obtained in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with a form label in advance, a target uploading form is generated according to the uploading form template and the storage address of the target file, and the target file and the target uploading form are sent to a server. Therefore, when a plurality of file uploading windows exist in the file uploading page, the uploading form template can be adopted to generate a target uploading form for file uploading processing, and a programmer only needs to create one uploading form template and fill in a form tag in the uploading form template when compiling page codes, so that the efficiency of compiling the uploading form can be improved.
Based on the same technical concept, an embodiment of the present invention further provides a file uploading apparatus, as shown in fig. 4, the apparatus includes:
a first obtaining module 401, configured to obtain a storage address of a target file input by a user in a file upload page;
a second obtaining module 402, configured to obtain an upload form template from a page plug-in of the file upload page, where the upload form template is an upload form in which a form tag is pre-written, and the upload form template is uniformly configured for all file upload windows in the file upload page;
a generating module 403, configured to generate a target upload form according to the upload form template and the storage address of the target file;
a sending module 404, configured to send the target file and the target upload form to a server.
Optionally, the generating module 403 is configured to:
recording the storage address of the target file to an input tag in a page code of the file uploading page, acquiring a Document Object Model (DOM) node of the input tag, moving the DOM node of the input tag to the uploading form template, and generating a target uploading form.
Optionally, the first obtaining module 401 is configured to:
acquiring a storage address of a target file input in a first file uploading window in a file uploading page by a user;
the generating module 403 is configured to:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
Optionally, as shown in fig. 5, the apparatus further includes:
the deleting module 405 is configured to, after a target upload form is generated, obtain a storage address of a new target file input by a user in a first file upload window in the file upload page, delete the first target upload form, and generate a new target upload form according to the upload form template and the storage address of the new target file.
The sending module 404 is configured to:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to a server.
Optionally, as shown in fig. 6, the apparatus further includes:
a creating module 406, configured to create an input tag at a DOM node of the input tag in a page code of the file upload page after moving the DOM node of the input tag into the upload form template.
Optionally, the sending module 404 is configured to:
and when a submission instruction of the target file input by a user is received, sending the target file and the target uploading form to a server.
In the embodiment of the invention, a storage address of a target file input by a user in a file uploading page is obtained, an uploading form template is obtained in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with a form label in advance, a target uploading form is generated according to the uploading form template and the storage address of the target file, and the target file and the target uploading form are sent to a server. Therefore, when a plurality of file uploading windows exist in the file uploading page, the uploading form template can be adopted to generate a target uploading form for file uploading processing, and a programmer only needs to create one uploading form template and fill in a form tag in the uploading form template when compiling page codes, so that the efficiency of compiling the uploading form can be improved.
It should be noted that: in the file uploading device provided in the above embodiment, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the file uploading device provided by the above embodiment and the file uploading method embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and will not be described herein again.
Referring to fig. 7, a schematic structural diagram of a terminal according to an embodiment of the present invention is shown, where the terminal may be used to implement the method for uploading a file provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the terminal 900 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal structure shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (low noise amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 900, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 500, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 7, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 900 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the terminal 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 900, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 900. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the terminal 900.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 900 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and it provides wireless broadband internet access for the user. Although fig. 7 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 900 and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 900, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 900 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Terminal 900 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to processor 180 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 900 may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 900 is a touch screen display, the terminal 900 further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring a storage address of a target file input by a user in a file uploading page;
acquiring an uploading form template in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with form tags in advance;
generating a target uploading form according to the uploading form template and the storage address of the target file;
and sending the target file and the target uploading form to a server.
Optionally, the generating a target upload form according to the upload form template and the storage address of the target file includes:
recording the storage address of the target file to an input tag in a page code of the file uploading page, acquiring a Document Object Model (DOM) node of the input tag, moving the DOM node of the input tag to the uploading form template, and generating a target uploading form.
Optionally, the obtaining a storage address of a target file input by a user in a file upload page includes:
acquiring a storage address of a target file input in a first file uploading window in a file uploading page by a user;
recording the storage address of the target file to an input tag in a page code of the file upload page, acquiring a DOM node of the input tag, moving the DOM node of the input tag to the upload form template, and generating a target upload form, including:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
Optionally, after generating the target upload form, the method further includes:
and acquiring a storage address of a new target file input in a first file uploading window in the file uploading page by a user, deleting the first target uploading form, and generating a new target uploading form according to the uploading form template and the storage address of the new target file.
The sending the target file and the target uploading form to a server comprises:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to a server.
Optionally, after the moving the DOM node of the input tag to the upload form template, the method further includes:
and in the page code of the file uploading page, creating an input tag at the DOM node of the input tag.
Optionally, the sending the target file and the target upload form to a server includes:
and when a submission instruction of the target file input by a user is received, sending the target file and the target uploading form to a server.
In the embodiment of the invention, a storage address of a target file input by a user in a file uploading page is obtained, an uploading form template is obtained in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with a form label in advance, a target uploading form is generated according to the uploading form template and the storage address of the target file, and the target file and the target uploading form are sent to a server. Therefore, when a plurality of file uploading windows exist in the file uploading page, the uploading form template can be adopted to generate a target uploading form for file uploading processing, and a programmer only needs to create one uploading form template and fill in a form tag in the uploading form template when compiling page codes, so that the efficiency of compiling the uploading form can be improved.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for uploading a file, the method comprising:
sending a page code acquisition request of a file uploading page to a server;
receiving a page code of the file uploading page and a page plug-in of the file uploading page sent by the server;
reading a page code of the file uploading page to display the file uploading page, wherein a plurality of file uploading windows exist in the file uploading page;
acquiring a storage address of a target file input by a user in a first file uploading window in the file uploading page, wherein the first file uploading window is any one of the file uploading windows;
acquiring an uploading form template in a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with form tags in advance;
writing the storage address of the target file into a corresponding position in the uploading form template to generate a target uploading form;
and sending the target file and the target uploading form to the server.
2. The method of claim 1, wherein writing the storage address of the target file to a corresponding location in the upload form template to generate a target upload form comprises:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
3. The method of claim 2, wherein after generating the target upload form, further comprising:
acquiring a storage address of a new target file input in a first file uploading window in the file uploading page by a user, deleting the first target uploading form, and generating a new target uploading form according to the uploading form template and the storage address of the new target file;
the sending the target file and the target upload form to the server includes:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to the server.
4. The method of claim 2, wherein after moving the DOM node of the first input tag into the upload form template, further comprising:
and in the page code of the file upload page, creating a first input tag at the DOM node of the first input tag.
5. The method of claim 1, wherein sending the target file and the target upload form to the server comprises:
and when a submission instruction of a target file input by a user is received, sending the target file and the target uploading form to the server.
6. An apparatus for uploading a file, the apparatus comprising:
the first acquisition module is used for sending a page code acquisition request of a file uploading page to the server; receiving a page code of the file uploading page and a page plug-in of the file uploading page sent by the server; reading a page code of the file uploading page to display the file uploading page, wherein a plurality of file uploading windows exist in the file uploading page; acquiring a storage address of a target file input by a user in a first file uploading window in the file uploading page, wherein the first file uploading window is any one of the file uploading windows;
the second acquisition module is used for acquiring an uploading form template from a page plug-in of the file uploading page, wherein the uploading form template is an uploading form which is uniformly configured for all file uploading windows in the file uploading page and is filled with form tags in advance;
the generating module is used for writing the storage address of the target file into a corresponding position in the uploading form template to generate a target uploading form;
and the sending module is used for sending the target file and the target uploading form to the server.
7. The apparatus of claim 6, wherein the generating module is configured to:
recording the storage address of the target file into a page code of the file uploading page, acquiring a DOM node of a first input label corresponding to a first file uploading window, moving the DOM node of the first input label into the uploading form template, and generating a first target uploading form.
8. The apparatus of claim 7, further comprising:
the deleting module is used for acquiring a storage address of a new target file input by a user in a first file uploading window in the file uploading page after a target uploading form is generated, deleting the first target uploading form and generating a new target uploading form according to the uploading form template and the storage address of the new target file;
the sending module is configured to:
and when a submission instruction of a new target file input by a user is received, sending the new target file and the new target uploading form to the server.
9. The apparatus of claim 7, further comprising:
and the creating module is used for creating the first input label at the DOM node of the first input label in the page code of the file upload page after the DOM node of the first input label is moved to the upload form template.
10. The apparatus of claim 6, wherein the sending module is configured to:
and when a submission instruction of a target file input by a user is received, sending the target file and the target uploading form to the server.
CN201610597685.1A 2016-07-26 2016-07-26 File uploading method and device Active CN106230919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610597685.1A CN106230919B (en) 2016-07-26 2016-07-26 File uploading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610597685.1A CN106230919B (en) 2016-07-26 2016-07-26 File uploading method and device

Publications (2)

Publication Number Publication Date
CN106230919A CN106230919A (en) 2016-12-14
CN106230919B true CN106230919B (en) 2020-03-17

Family

ID=57534339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610597685.1A Active CN106230919B (en) 2016-07-26 2016-07-26 File uploading method and device

Country Status (1)

Country Link
CN (1) CN106230919B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451279A (en) * 2017-08-07 2017-12-08 福建中金在线信息科技有限公司 File uploading method, device, electronic equipment and computer-readable recording medium
CN109743405A (en) * 2019-02-20 2019-05-10 高新兴科技集团股份有限公司 Load balancing file uploading method, system, computer storage medium and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174954A (en) * 2006-10-31 2008-05-07 上海高勤通信科技有限公司 Document breaking point uploading method based on internet hypertext transfer protocol
CN101465931A (en) * 2007-12-20 2009-06-24 佳能株式会社 Image processing apparatus and method thereof
CN101651711A (en) * 2009-09-11 2010-02-17 北京工业大学 HTTP network access achieving method based on serial communication
CN102307219A (en) * 2011-03-18 2012-01-04 北京神州数码思特奇信息技术股份有限公司 File access system, file uploading method and file downloading method
CN103853712A (en) * 2012-11-28 2014-06-11 金蝶软件(中国)有限公司 Display method of floating layer window and browser

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245227A1 (en) * 2006-04-13 2007-10-18 Workflow.Com, Llc Business Transaction Documentation System and Method
US8386535B2 (en) * 2011-07-29 2013-02-26 Ricoh Company, Ltd. Form processing cloud service with template repository

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174954A (en) * 2006-10-31 2008-05-07 上海高勤通信科技有限公司 Document breaking point uploading method based on internet hypertext transfer protocol
CN101465931A (en) * 2007-12-20 2009-06-24 佳能株式会社 Image processing apparatus and method thereof
CN101651711A (en) * 2009-09-11 2010-02-17 北京工业大学 HTTP network access achieving method based on serial communication
CN102307219A (en) * 2011-03-18 2012-01-04 北京神州数码思特奇信息技术股份有限公司 File access system, file uploading method and file downloading method
CN103853712A (en) * 2012-11-28 2014-06-11 金蝶软件(中国)有限公司 Display method of floating layer window and browser

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"如何使用表单上传图片文件";百度经验;《百度经验》;20140406;全文 *

Also Published As

Publication number Publication date
CN106230919A (en) 2016-12-14

Similar Documents

Publication Publication Date Title
CN106775637B (en) Page display method and device for application program
TWI512525B (en) Method and system for associating two terminals with each other, terminal and computer-readable storage medium
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
CN104852885B (en) Method, device and system for verifying verification code
WO2015154670A1 (en) Method and apparatus for invoking application programming interface
CN111984165A (en) Method and device for displaying message and terminal equipment
WO2018196588A1 (en) Information sharing method, apparatus and system
CN107329985B (en) Page collection method and device and mobile terminal
US9921735B2 (en) Apparatuses and methods for inputting a uniform resource locator
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
CN106970790B (en) Application program creating method, related equipment and system
CN104869465A (en) Video playing control method and device
CN104104711A (en) Reading history processing method and device
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
CN106230919B (en) File uploading method and device
CN106095423B (en) Method, terminal and server for providing browsing service
KR101876394B1 (en) Method and device for playing media data on a terminal
WO2015067206A1 (en) File searching method and terminal
CN107766351B (en) File directory identification method and device
WO2017161994A1 (en) Method and device for displaying page, and computer storage medium
CN105631059B (en) Data processing method, data processing device and data processing system
CN105095161B (en) Method and device for displaying rich text information
CN107346347B (en) Webpage table display method and device
CN106933626B (en) Application association method and device
CN108073647B (en) Webpage display method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

GR01 Patent grant
GR01 Patent grant