CN-122019859-A - File upload modification for client applications
Abstract
Methods and systems for a client computing device are provided, including a browser rendering a web page, program code generating a simulated upload event and corresponding simulated data transfer objects for uploading data using the web page. The simulated upload event and corresponding simulated data transfer object are propagated to the upload event listener of the web page and executed. Before generating the simulated upload event and the corresponding simulated data transfer object, the embedded upload event listener may receive the upload event, read the upload event, discard the received upload event from the event processing pipeline, and synchronously or asynchronously invoke code to execute logic on the received upload event for simulating the generation of the upload event and the corresponding simulated data transfer object.
Inventors
- G. Lewen
- A. Gerry
- Y. Harper
Assignees
- 微软技术许可有限责任公司
Dates
- Publication Date
- 20260512
- Application Date
- 20210330
- Priority Date
- 20200529
Claims (20)
- 1. A system in a client computing device, comprising: an embedded upload event listener registered to be executed before one or more other event listeners of the web page; a simulated upload event generator comprising program code configured to generate a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page, wherein the program code is configured to be executed in the client computing device; A dispatcher configured to propagate the simulated upload event and the corresponding simulated data transfer object to an upload event listener of the web page; an event handler configured to execute the simulated upload event.
- 2. The system of claim 1, wherein the data comprises a file, a plurality of files, a directory, or a plurality of directories.
- 3. The system of claim 1, wherein the simulated upload event performs at least one of: The file is modified and the file is modified, The file name is changed and the file name is changed, The content of the file is changed and, A file is created and the file is created, Changing lists of files in directories, or A file system is created.
- 4. The system of claim 1, wherein prior to the simulated upload event generator generating a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page, the embedded upload event listener is configured to: intercepting a received uploading event; reading the received uploading event; discarding the received upload event from the upload event handler pipeline, and Code is invoked either synchronously or asynchronously to execute logic on the received upload event.
- 5. The system of claim 4, wherein the program code configured to generate a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page is configured to modify the received upload event.
- 6. The system of claim 4, wherein the embedded upload event listener is configured to respond to a drag-and-drop input or a select input in a dialog element input of the web page.
- 7. The system of claim 4, wherein the simulated upload event generator is configured to: sending a query to a proxy server, the query including metadata about the received upload event, and Receiving a response to the query from the proxy server, the response comprising instructions; wherein the simulated upload event generator comprising program code is further configured to generate the simulated upload event and the corresponding simulated data transfer object based on the instructions received from the proxy server.
- 8. The system of claim 1, wherein the simulated upload event is a substitute for the discarded upload event.
- 9. The system of claim 1, wherein the simulated upload event generator comprises at least one of: Script browser extension code; Changing script code of the received event; new script code, or Script code is injected as a library of hooks into the web page.
- 10. The system of claim 1, wherein the simulated upload event generator is script code of a scripting language.
- 11. A method in a client computing device, comprising: registering an embedded upload event listener to be executed prior to one or more other event listeners of the web page; Generating, by program code configured to execute in a client computing device, a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page; an upload event listener for propagating the simulated upload event and the corresponding simulated data transfer object to the web page, and And executing the simulation uploading event.
- 12. The method of claim 11, wherein the simulated upload event performs at least one of: The file is modified and the file is modified, The file name is changed and the file name is changed, The content of the file is changed and, A file is created and the file is created, Changing lists of files in directories, or A file system is created.
- 13. The method of claim 11, wherein prior to the generating, by program code configured to execute in the client computing device, a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page, the method further comprises: intercepting, by an embedded upload event listener, the received upload event; reading the received uploading event; discarding the received upload event from the upload event handler pipeline, and Code is invoked by the embedded event listener synchronously or asynchronously to execute logic for the received upload event for the generating.
- 14. The method of claim 13, further comprising: sending a query to a proxy server, the query including metadata about the received upload event, and Receiving a response to the query from the proxy server, the response comprising instructions; Wherein the generating of the simulated upload event and the corresponding simulated data transfer object for uploading data using the web page by program code configured to execute in the client computing device is based on the instructions received from the proxy server.
- 15. The method of claim 11, wherein the simulated upload event is a replacement for a discarded upload event.
- 16. The method of claim 11, wherein the simulated upload event generator comprises at least one of: Script browser extension code; Changing script code of the received event; new script code, or Script code is injected as a library of hooks into the web page.
- 17. The method of claim 11, the simulated upload event generator is script code of a scripting language.
- 18. A physical hardware computer readable medium having program code recorded thereon, which when executed by at least one processor causes the at least one processor to perform a method comprising: registering an embedded upload event listener to be executed prior to one or more other event listeners of the web page; Generating, by program code configured to execute in a client computing device, a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page; an upload event listener for propagating the simulated upload event and the corresponding simulated data transfer object to the web page, and And executing the simulation uploading event.
- 19. The physical hardware computer readable medium of claim 18, wherein prior to the generating, by program code configured to execute in the client computing device, a simulated upload event and a corresponding simulated data transfer object for uploading data using the web page, the method further comprises: intercepting, by an embedded upload event listener, the received upload event; reading the received uploading event; discarding the received upload event from the upload event handler pipeline, and Code is invoked by the embedded event listener synchronously or asynchronously to execute logic for the received upload event for the generating.
- 20. The physical hardware computer-readable medium of claim 19, further comprising: sending a query to a proxy server, the query including metadata about the received upload event, and Receiving a response to the query from the proxy server, the response comprising instructions; Wherein the generating of the simulated upload event and the corresponding simulated data transfer object for uploading data using the web page by program code configured to execute in the client computing device is based on the instructions received from the proxy server.
Description
File upload modification for client applications RELATED APPLICATIONS The application is a divisional application of an application patent application with the application number 202180038840.5 and the application name of file uploading modification of a client application. Background Web pages presented in browser interfaces often provide interactive components, such as drag and drop mechanisms and/or dialog boxes, that enable a user to select a file or directory to upload to a remote system, such as a server. For example, when a user drags a file or directory into a drop-down box component in a web page, software on the client device receives the upload event and dispatches the event to the event handler to retrieve the file (or list of files in the directory) and transmits the file to a determined remote system. The upload event propagates without modification. In addition, when multiple files are uploaded in one event, the system either transmits all files or refuses to upload all files. Still further, all files of an upload event triggered by dragging a file directory into a drop-down box are uploaded. Disclosure of Invention This abstract is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This abstract is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Methods and systems are provided in a client computing device that are capable of modifying an upload event prior to actually uploading. In one aspect, a client computing device includes a system including a browser, an analog upload event generator, a dispatcher, and an event handler. The browser is configured to present a web page. The simulated upload event generator comprises program code configured to generate a simulated upload event and a corresponding simulated data transfer object for uploading data using a web page. The program code is configured to execute in a client computing device. The dispatcher is configured to propagate the simulated upload event and the corresponding simulated data transfer object to an upload event listener of the web page. The event handler is configured to perform an analog upload event. In some embodiments, the client computing device includes an embedded upload event listener. Before the simulated upload event generator generates the simulated upload event and the simulated data transfer object, the embedded upload event listener is configured to intercept the received upload event, read the received upload event, discard the received upload event from the upload event handler pipeline, and invoke code to execute logic on the received upload event. Further features and advantages of the embodiments, as well as the structure and operation of the various embodiments, are described in detail below with reference to the accompanying drawings. It should be noted that the method and system are not limited to the specific embodiments described herein. Such embodiments are presented herein for illustrative purposes only. Other embodiments will be apparent to those skilled in the relevant art based on the teachings contained herein. Drawings The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments of the present application and, together with the description, further serve to explain the principles of the embodiments and to enable a person skilled in the pertinent art to make and use the embodiments. FIG. 1 is a block diagram of a system for generating simulated upload events in a web page to process files uploaded from a client device in accordance with an exemplary embodiment. FIG. 2 is a flowchart providing a method for generating a simulated upload event to process a file uploaded from a client device in accordance with an exemplary embodiment. Fig. 3 is a system block diagram for intercepting a received upload event by an embedded upload event listener and generating a simulated upload event based on the received upload event according to an exemplary embodiment. Fig. 4 is a flowchart providing a method for intercepting a received upload event by an embedded upload event listener and invoking code to perform logic on the received upload event in accordance with an exemplary embodiment. FIG. 5 is a flowchart providing a method for sending a query to a server regarding a received upload event and receiving a response comprising instructions for generating a simulated upload event in accordance with an exemplary embodiment. FIG. 6 is an example block diagram of a processor-based computer system that may be used to implement various embodiments. Features and advantages of the embodiments described herein will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like reference characters i