Method for downloading and uploading file by calling shell script based on web page

By defining configuration information and script parameters on a web page and writing a Java implementation class to call shell script commands, the problem of the inability to visualize file download and upload in existing technologies is solved, realizing visualization of file upload and download and improving efficiency.

CN121567690APending Publication Date: 2026-02-24SHANGHAI TONGLIAN FINANCIAL SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511679164.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies make it difficult to visualize file downloads and uploads via web pages, resulting in a lack of clear understanding of file upload and download status and impacting accounting efficiency.

Method used

By creating a new web page, defining the remote file server configuration information and script parameters, writing a Java implementation class to call external system commands, and assembling shell script commands, the file download and upload process can be realized.

Benefits of technology

It enables visualized file download and upload, providing a clear understanding of the upload and download status of each file and improving accounting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567690A_ABST
    Figure CN121567690A_ABST
Patent Text Reader

Abstract

The invention relates to a method for downloading and uploading a file by calling a shell script based on a web page, which comprises the following steps of: newly establishing a set of web page for importing a required file; defining configuration information of the remote file server; defining a file list ftp configuration list which corresponds to the server and needs to be acquired; defining instance parameters for calling the script to download the file; writing a specific script to realize file downloading; a java implementation class is compiled, a run service class is used to call a command of an external system for processing, a shell script command is assembled to call a corresponding script, and file downloading and uploading processing is carried out. According to the method and the device, the shell script is visually called based on the web page to download and upload the file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of file management technology, and in particular to a method for downloading and uploading files by calling a shell script from a web page. Background Technology

[0002] In the processing of financial reconciliation documents, it is often necessary to download and upload files from different servers in order to process the accounting entries.

[0003] Existing technologies make it difficult to achieve visualized file download and upload based on web pages, resulting in an inability to clearly understand the upload and download status of each file and affecting accounting efficiency.

[0004] Therefore, it is necessary to provide a method for downloading and uploading files by calling shell scripts from a web page, so as to realize a visual method for downloading and uploading files by calling shell scripts from a web page. Summary of the Invention

[0005] The purpose of this invention is to provide a method for downloading and uploading files by calling shell scripts from a web page, thereby enabling a visual method for downloading and uploading files by calling shell scripts from a web page.

[0006] To address the problems existing in the prior art, this invention provides a method for downloading and uploading files by calling a shell script from a web page, comprising the following steps:

[0007] Create a new web page to import the necessary files;

[0008] Define the configuration information for the remote file server;

[0009] Define the FTP configuration list of the files that need to be retrieved for the corresponding server.

[0010] Define the instance parameters for calling the script to download the file;

[0011] Write a specific script to download the file;

[0012] Write a Java implementation class that uses a runtime service class to call commands from an external system for processing, assemble shell script commands to call the corresponding scripts, and perform file download and upload processing.

[0013] Optionally, in the method of calling a shell script based on a web page to download and upload files,

[0014] Define the necessary action buttons on the web page, including import and export buttons, to implement specific download or upload operations.

[0015] Define the channel and file name for importing files on the web page;

[0016] The service corresponding to the binding button is used to initiate import or export operations for the process.

[0017] Optionally, in the method of calling a shell script from a web page to download and upload files, the configuration information of the remote file server includes:

[0018] Define the IP address of the server node where the server process resides;

[0019] Define the port on the server where the server process resides;

[0020] Define the username for logging into the server;

[0021] Define the password for logging into the server;

[0022] Define the login method for the server, which can be either FTP or SFTP.

[0023] Define the server path where the login server files are located;

[0024] Define the specific name of the server to distinguish different servers.

[0025] Optionally, in the method of calling a shell script based on a web page to download and upload files, the FTP configuration list of the files to be retrieved corresponding to the server includes:

[0026] Define the list of files to be retrieved for the server;

[0027] Define how the file is processed.

[0028] Optionally, in the method of calling a shell script based on a web page to download and upload files, the file processing methods include creating an empty file or modifying the file name.

[0029] Optionally, in the method of calling a shell script based on a web page to download and upload files, the instance parameters for calling the script to download files include:

[0030] Define the name of the script that will perform file upload and download;

[0031] Define the file path for the script that needs to perform file upload and download;

[0032] Define the file names of the list of files to be downloaded;

[0033] Define the organization number to be executed; different organizations correspond to different organization numbers.

[0034] Define the task type to be performed, which is either upload or download.

[0035] Optionally, in the method of calling a shell script based on a web page to download and upload files, a specific script is written to implement the file download, including the following steps:

[0036] Define the input parameters for script execution;

[0037] Check if the submitted filename is included in the rule name file list. If it is not included, throw an exception and the download will fail. If it is included, proceed to the next step.

[0038] Check if the uploaded filename is included in the FTP configuration file of the file list, which is used to define personalized file download configuration settings;

[0039] Based on the channel, system type, and organization number, obtain the corresponding server information, log in to the server, retrieve the files in the corresponding batch date directory, and download the files to the corresponding file directory.

[0040] Optionally, in the method of calling a shell script based on a web page to download and upload files, the input parameters for script execution include: the batch date of the script execution upload, the channel of the script execution upload, the file name of the script execution upload, the organization number of the script execution upload, the rule name of the script execution upload, and the system type of the script execution upload.

[0041] Optionally, in the method of calling a shell script based on a web page to download and upload files, the file download and upload process includes the following steps:

[0042] Obtain the corresponding channel from the page;

[0043] Retrieve the corresponding file name from the page;

[0044] The operation type for the corresponding file is obtained from the page; the operation type is either upload or download.

[0045] Obtain the instance parameters for the corresponding channel based on the channel;

[0046] The script commands to be executed during assembly and the input parameters required for script execution;

[0047] Call the runtime service to execute script commands and perform file upload and download tasks.

[0048] Get the execution result of the file.

[0049] Optionally, in the method of calling a shell script based on a web page to download and upload files, the input parameters required for script execution include the script execution path and script name, the batch execution date to be executed, the channel corresponding to the file, the file name, the name of the organization to be executed, the path and name of the rule file to be executed, and the system type to be executed, wherein the system type is upload or download.

[0050] Compared with the prior art, the present invention has the following advantages:

[0051] This invention enables visualized file download and upload via web page-based shell script invocation, providing a clear understanding of the upload and download status of each file and improving accounting efficiency. Attached Figure Description

[0052] Figure 1 A flowchart illustrating the download and upload method provided in an embodiment of the present invention. Detailed Implementation

[0053] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.

[0054] In the following, if the methods described herein include a series of steps, and the order of these steps presented herein is not necessarily the only order in which these steps can be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.

[0055] Existing technologies make it difficult to achieve visualized file download and upload based on web pages, resulting in an inability to clearly understand the upload and download status of each file and affecting accounting efficiency.

[0056] To address the problems existing in the prior art, this invention provides a method for downloading and uploading files by calling a shell script from a web page, such as... Figure 1 The above includes the following steps:

[0057] S1: Create a new web page to import the required files;

[0058] Specifically, it includes the following steps:

[0059] S11: Define the necessary operation buttons on the web page, including import and export buttons, to implement specific download or upload operations.

[0060] S12: Define the channel and file name for which files need to be imported in the web page;

[0061] S13: Bind the service corresponding to the button, used to initiate import or export operations for the process.

[0062] S2: Defines the configuration information for the remote file server, including:

[0063] Define the IP address of the server node where the server process resides;

[0064] Define the port on the server where the server process resides;

[0065] Define the username for logging into the server;

[0066] Define the password for logging into the server;

[0067] Define the login method for the server. The login methods include FTP (File Transfer Protocol) or SFTP (SSH File Transfer Protocol). SFTP is an encrypted file transfer protocol based on SSH. It ensures the security of data transmission through an encrypted tunnel and is often used for the transfer of confidential files in enterprises or organizations.

[0068] Define the server path where the login server files are located;

[0069] Define the specific name of the server to distinguish different servers.

[0070] S3: Defines the list of files to be retrieved for the server (FTP configuration list), including:

[0071] Define the list of files to be retrieved for the server;

[0072] Define how the file is processed, including creating an empty file or renaming a file.

[0073] S4: Defines the instance parameters for calling the script to download files, including:

[0074] Define the name of the script that will perform file upload and download;

[0075] Define the file path for the script that needs to perform file upload and download;

[0076] Define the file names of the list of files to be downloaded;

[0077] Define the organization number to be executed; different organizations correspond to different organization numbers.

[0078] Define the task type to be performed, which is either upload or download.

[0079] S5: Write a specific script to download the file, including the following steps:

[0080] S51: Define the input parameters for script execution; the input parameters for script execution include: the batch date for script execution submission, the channel for script execution submission, the file name for script execution submission, the organization number for script execution submission, the rule name for script execution submission, and the system type for script execution submission.

[0081] S52: Check if the uploaded filename is included in the rule name file list. If it is not included, throw an exception and the download will fail. If it is included, proceed to the next step.

[0082] S53: Check if the uploaded filename is included in the FTP configuration file of the file list, which is used to define personalized file download configuration settings;

[0083] S54: Based on the channel, system type, and organization number, obtain the corresponding server information, log in to the server, retrieve the files in the corresponding batch date directory, and download the files to the corresponding file directory.

[0084] S6: Write a Java implementation class that uses a runtime service class to call commands from an external system for processing, assembling shell script commands to call corresponding scripts, and handling file download and upload. Runtime service classes are core components for managing the application's runtime environment and are commonly found in workflow engines, Java Virtual Machines, and frameworks such as ASP.NET.

[0085] Specifically, it includes the following steps:

[0086] S61: Obtain the corresponding channel based on the page;

[0087] S62: Obtain the corresponding file name based on the page;

[0088] S63: Obtain the operation type of the corresponding file based on the page; the operation type is upload or download.

[0089] S64: Obtain the instance parameters of the corresponding channel based on the channel;

[0090] S65: The script commands to be executed during assembly and the input parameters required for script execution; the input parameters required for script execution include the script execution path and script name, the batch execution date to be executed, the channel corresponding to the file, the file name, the name of the organization to be executed, the path and name of the rule file to be executed, and the system type to be executed, which is upload or download;

[0091] S66: Calls the runtime service to execute script commands, and performs file upload and download operations.

[0092] S67: Get the execution result of the file.

[0093] In summary, compared with the prior art, the present invention has the following advantages:

[0094] This invention enables visualized file download and upload via web page-based shell script invocation, providing a clear understanding of the upload and download status of each file and improving accounting efficiency.

[0095] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A method for downloading and uploading files by calling a shell script from a web page, characterized in that, Includes the following steps: Create a new web page to import the necessary files; Define the configuration information for the remote file server; Define the FTP configuration list of the files that need to be retrieved for the corresponding server. Define the instance parameters for calling the script to download the file; Write a specific script to download the file; Write a Java implementation class that uses a runtime service class to call commands from an external system for processing, assemble shell script commands to call the corresponding scripts, and perform file download and upload processing.

2. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 1, is characterized in that... Define the necessary action buttons on the web page, including import and export buttons, to implement specific download or upload operations. Define the channel and file name for importing files on the web page; The service corresponding to the binding button is used to initiate import or export operations for the process.

3. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 2, is characterized in that... The configuration information for defining a remote file server includes: Define the IP address of the server node where the server process resides; Define the port on the server where the server process resides; Define the username for logging into the server; Define the password for logging into the server; Define the login method for the server, which can be either FTP or SFTP. Define the server path where the login server files are located; Define the specific name of the server to distinguish different servers.

4. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 3, is characterized in that... The FTP configuration list defines the list of files that need to be retrieved for the server. Define the list of files to be retrieved for the server; Define how the file is processed.

5. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 4, is characterized in that... File processing methods include creating empty files or renaming files.

6. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 4, is characterized in that... The instance parameters for defining the script to download files include: Define the name of the script that will perform file upload and download; Define the file path for the script that needs to perform file upload and download; Define the file names of the list of files to be downloaded; Define the organization number to be executed; different organizations correspond to different organization numbers. Define the task type to be performed, which is either upload or download.

7. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 6, is characterized in that... Write a specific script to download the file, including the following steps: Define the input parameters for script execution; Check if the submitted filename is included in the rule name file list. If it is not included, throw an exception and the download will fail. If it is included, proceed to the next step. Check if the uploaded filename is included in the FTP configuration file of the file list, which is used to define personalized file download configuration settings; Based on the channel, system type, and organization number, obtain the corresponding server information, log in to the server, retrieve the files in the corresponding batch date directory, and download the files to the corresponding file directory.

8. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 7, is characterized in that... The input parameters for script execution include: the batch date of script execution, the channel of script execution, the file name of script execution, the organization number of script execution, the rule name of script execution, and the system type of script execution.

9. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 7, is characterized in that... The process of downloading and uploading files includes the following steps: Obtain the corresponding channel from the page; Retrieve the corresponding file name from the page; The operation type for the corresponding file is obtained from the page; the operation type is either upload or download. Obtain the instance parameters for the corresponding channel based on the channel; The script commands to be executed during assembly and the input parameters required for script execution; Call the runtime service to execute script commands and perform file upload and download tasks. Get the execution result of the file.

10. The method for downloading and uploading files based on a web page calling a shell script, as described in claim 9, is characterized in that... The input parameters required for script execution include the script execution path and script name, the batch execution date for the current day, the channel corresponding to the file, the file name, the name of the organization to be executed, the path and name of the rule file to be executed, and the system type to be executed, which is upload or download.