CN110769016A - File uploading method and computer storage medium - Google Patents

File uploading method and computer storage medium Download PDF

Info

Publication number
CN110769016A
CN110769016A CN201810842589.8A CN201810842589A CN110769016A CN 110769016 A CN110769016 A CN 110769016A CN 201810842589 A CN201810842589 A CN 201810842589A CN 110769016 A CN110769016 A CN 110769016A
Authority
CN
China
Prior art keywords
uploaded
file
uploading
files
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810842589.8A
Other languages
Chinese (zh)
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.)
Yiduhuida Educational Technology (beijing) Co Ltd
Original Assignee
Yiduhuida Educational Technology (beijing) 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 Yiduhuida Educational Technology (beijing) Co Ltd filed Critical Yiduhuida Educational Technology (beijing) Co Ltd
Priority to CN201810842589.8A priority Critical patent/CN110769016A/en
Publication of CN110769016A publication Critical patent/CN110769016A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a file uploading method and a computer storage medium. The file uploading method comprises the following steps: acquiring a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded; performing confusion operation on the original file name of each file to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded; according to the generated uploading file name of each file to be uploaded, constructing an uploading object corresponding to each file to be uploaded; and uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object. The file uploading method can upload files in batches.

Description

File uploading method and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a file uploading method and a computer storage medium.
Background
With the development of science and technology, cloud computing, cloud storage, cloud servers and the like are increasingly popularized. Taking a cloud server as an example, the cloud server is a computer device which is simple, efficient, safe, reliable, and elastically stretchable in processing capacity. The function of the physical server can be realized, and the management mode is simpler and more efficient than the physical server. A user can rapidly create or release any plurality of cloud servers without purchasing hardware in advance. In addition, the user of the cloud server can save the site cost and the related maintenance cost which are necessary for setting the physical server. Based on these advantages, more and more developers are willing to use cloud servers for development.
However, the existing cloud server also has some problems in the using process, for example, when a user uses and operates the cloud server, the user needs to frequently and massively transmit data and files to the cloud server, and many existing cloud servers can only support single file uploading due to the limitation of an operation platform or system performance, but cannot support batch uploading of a plurality of files, so that the user is inconvenient to transmit files, the transmission process is complicated, and the user is not favorable to use, and the problem of file mis-coverage caused by the files with the same name existing in the cloud server may exist in the process of uploading files one by the user, so that the use of subsequent cloud services is influenced.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a file uploading method and a computer storage medium, so as to overcome the inconvenience of uploading files in batches by a cloud server in the prior art.
The embodiment of the invention provides a file uploading method, which comprises the following steps: acquiring a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded; carrying out confusion operation on the original file names of the files to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded; according to the generated uploading file name of each file to be uploaded, constructing an uploading object corresponding to each file to be uploaded; and uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores: the method comprises the steps of obtaining a list of files to be uploaded, wherein the list of files to be uploaded comprises original file names of a plurality of files to be uploaded; the command is used for performing confusion operation on the original file name of each file to be uploaded by using preset confusion parameters to generate uploading file names of the corresponding files to be uploaded; the command is used for constructing an uploading object corresponding to each file to be uploaded according to the generated uploading file name of each file to be uploaded; and the instruction is used for uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
According to the file uploading scheme, the corresponding uploading object is constructed according to the uploading file name of each file to be uploaded, the file to be uploaded is uploaded according to the uploading object, batch uploading operation of the files to be uploaded in the file list to be uploaded can be achieved, a cloud server user can upload the files to the cloud server more conveniently, and the problem that in the prior art, only a single file can be uploaded by a cloud server, and operation is inconvenient is solved.
In addition, after the file uploading method obtains a to-be-uploaded file list comprising a plurality of to-be-uploaded files, confusion operation is carried out on original file names of the to-be-uploaded files in the to-be-uploaded file list to generate corresponding uploaded file names, so that the uploaded file names of the to-be-uploaded files keep independence, independence of the files after the files are uploaded to the cloud server is guaranteed, and the situation that the files are mistakenly covered due to the existence of duplicate-name files is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
Fig. 1 shows a flowchart of a file uploading method according to a first embodiment of the present invention.
Fig. 2 shows a flowchart of a file uploading method according to a second embodiment of the present invention.
Detailed Description
Of course, it is not necessary for any particular embodiment of the invention to achieve all of the above advantages at the same time.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
Fig. 1 shows a flowchart of a file uploading method according to a first embodiment of the present invention. As shown in fig. 1, the file uploading method of the embodiment of the present invention includes the following steps:
step S101: and acquiring a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded.
The file to be uploaded list is used for indicating a plurality of (two or more) files to be uploaded selected by a user. And when the user selects to upload a plurality of files, generating a file list to be uploaded. The file list to be uploaded may include information of a plurality of files to be uploaded, for example, information including an original file name, a file type, a file size, a storage address, and the like of each file to be uploaded.
Of course, the information of the file to be uploaded included in the file to be uploaded list is not limited to the aforementioned exemplary information, and it may also include other information such as creation time and the like as needed.
The list of files to be uploaded (denoted filelist) may take any suitable form, for example, in the form of an array.
Step S102: and performing confusion operation on the original file names of the files to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded.
In order to ensure the independence of the files after the files are uploaded to the cloud server, in the embodiment of the invention, before the files are uploaded, the original file names of the files to be uploaded are subjected to confusion operation to generate the uploaded file names, so that the files to be uploaded can keep independence, and the files cannot be renamed with the files already stored on the cloud server after being uploaded to the cloud server, and the files already existing on the cloud server can be prevented from being covered by mistake.
Name obfuscation is one of obfuscation protection techniques that may replace an ideographic name with a meaningless name. In the embodiment of the invention, the original file names of the files to be uploaded are subjected to the obfuscation operation, so that on one hand, the obfuscated file names are not repeated, and on the other hand, the data protection effect is achieved to a certain extent.
The confusion parameter preset according to the requirement may be any suitable parameter, which is not limited in the embodiment. For example, the preset obfuscation parameter may include an operation time for performing an obfuscation operation on an original filename of the file to be currently uploaded. Because the operation time has non-repeatability, the generated uploading file name can be well ensured to have independence by using the time as the confusion parameter, and the generated uploading file name can not be repeated with other uploading file names, thereby ensuring the independence of the file to be uploaded.
Step S103: and constructing an uploading object corresponding to each file to be uploaded according to the generated uploading file name of each file to be uploaded.
The uploading object is used for indicating a target object of uploading operation. In the embodiment of the invention, one uploading object can be constructed for all the files to be uploaded, and a corresponding uploading object can be constructed for each file to be uploaded.
The uploading object may include an uploading file name, an uploading sequence identifier, a file type, a file size, and the like of the file to be uploaded. The uploading sequence identifier is used for indicating the uploading sequence of each file to be uploaded in the file list to be uploaded. Meanwhile, the uploading sequence identifier can also be used for distinguishing each uploading operation according to different uploading sequence identifiers when a plurality of uploading operations are carried out simultaneously.
Step S104: and uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
After the uploading object is constructed, the file to be uploaded can be uploaded, and batch uploading of a plurality of files to be uploaded is realized.
According to the file uploading method, the corresponding uploading object is constructed according to the uploading file name of each file to be uploaded, and the uploading operation is performed on each file to be uploaded according to the uploading object, so that the batch uploading operation of each file to be uploaded in the file list to be uploaded can be realized, a cloud server user can upload the file to the cloud server more conveniently, and the problem that in the prior art, the operation is inconvenient because the cloud service can only upload a single file is solved.
In addition, after the file uploading method obtains a to-be-uploaded file list comprising a plurality of to-be-uploaded files, confusion operation is carried out on original file names of the to-be-uploaded files in the to-be-uploaded file list to generate corresponding uploaded file names, so that the uploaded file names of the to-be-uploaded files keep independence, independence of the files after the files are uploaded to the cloud server is guaranteed, and the situation that the files are mistakenly covered due to the existence of duplicate-name files is avoided.
Example two
Fig. 2 shows a flowchart of a file uploading method according to a second embodiment of the present invention. In the present embodiment, the file uploading method is implemented by using a component of a virtual DOM (Document Object Model), and is applied to any appropriate js scene, such as a computer, a smart terminal, a web app, and the like. For example, the file upload method may be implemented by a vue.js component, but is not limited to the vue component. The vue-based component can load the upload component into any client (e.g., a browser) capable of running vue programs, so as to upload files to the cloud server.
As shown in fig. 2, the file uploading method of the embodiment of the present invention includes the following steps:
step S201: and acquiring and sending the user account and the user password.
When a user uses the service of the cloud server, the user account and the user password need to be sent to the cloud server to verify whether the user is a legal user; and the operation authority of the user can be determined through the user account and the user password, and whether the operation of the user is legal or not is verified. For example, whether the user is a legal user can be verified by acquiring and sending the user account and the user password, and whether the user has the authority to upload the file to the cloud server can be verified.
And after the user account and the user password are obtained, the user account and the user password are sent to the cloud server, the cloud server verifies whether the user account and the user password are correct and matched, and a verification result is returned. If the verification result is correct, the steps S202 to S210 may be executed to upload the batch file. Otherwise, the user account or password may be indicated as wrong.
Step S202: and setting a batch uploading file identifier.
The batch uploading file identifier is used for indicating whether batch uploading is performed or not, and can be realized by directly adopting a default setting mode in a corresponding code, such as a mode of setting a multiple tag, or can be realized by setting after receiving a triggering operation of a user on batch uploading files.
For example, when the multiple tag mode is adopted, the input tag of the native html supports the specific format, such as < tal-upload: 'true' > < tal-upload >. Wherein tal-upload is the name of the uploading component.
When multiple is 'true', the batch uploading file identifier indicates that batch uploading is performed, and at this time, the user may select a plurality of files in the pop-up box and generate a list of files to be uploaded.
When multiple is 'false', the batch uploading file identification indicates that batch uploading is not performed, and single file uploading is performed. When a single File is uploaded, a File type File is generated, wherein the File type File comprises information of files to be uploaded, such as File size, File type, uploading time and the like.
The following description will mainly describe the file uploading method by taking batch uploading as an example.
Step S203: and acquiring a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded.
The file to be uploaded list is used for indicating information of the file to be uploaded selected by the user. Under the condition that the batch uploading file identification is set, the acquisition of the file list to be uploaded can be realized as follows: and acquiring a list of files to be uploaded according to the set batch file uploading identification. That is, when it is determined that the batch files need to be uploaded according to the batch uploading file identifier, the list of the files to be uploaded is obtained.
When batch uploading is performed, the generated to-be-uploaded file list may be a Filelist file (which may include a plurality of file files), the Filelist file may specifically be an array, each element of the array corresponds to information of one to-be-uploaded file, for example, each element includes an original file name, a file type, a file size, a storage address, and the like of each to-be-uploaded file.
Step S204: and performing confusion operation on the original file names of the files to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded.
For a cloud server which only supports single File uploading and does not support Filelist File uploading, in a feasible manner, when a user needs to upload a plurality of files to be uploaded, a plurality of File files in the Filelist File can be split and uploaded one by one, the operation shields the user, the user does not need to know and does not need to perform repeated uploading operation for many times, and the user can upload a plurality of files only by one operation.
When files are uploaded in batches, in order to ensure that the uploaded files cannot influence the files stored in the cloud server (such as files with the same name are wrongly covered), the original file names of the files to be uploaded are subjected to confusion operation, and the file names to be uploaded are generated, so that the files to be uploaded can keep independence.
In this embodiment, the preset obfuscating parameter includes an operation time for performing an obfuscating operation on an original filename of a file to be uploaded currently (if the operation time is "4/3/15/22 minutes" in 2017, the preset obfuscating parameter corresponds to "201704031522"). And generating the uploading file name in a mode of confusing the operation time and the original file name. Because the operation time has non-repeatability, the generated uploading file name can be well ensured to have independence by using the time as the confusion parameter, thereby ensuring the independence of the file to be uploaded.
For those skilled in the art, any suitable obfuscating method may be adopted for obfuscating the original file name, and this embodiment is not limited thereto. For example, a new upload file name is generated according to the operation time and the original file name; or generating a new uploading file name by a mode of mixing the confusion parameter and the random number. Further optionally, the uploaded file name may be further processed to be converted into a file name format meeting the server requirements. In addition, the length of the converted uploaded file name can be set as required, so that the length of the uploaded file name is ensured to meet the requirement of the cloud server, and the phenomenon that the uploaded file name is too long and is intercepted by the cloud server is avoided. In order to facilitate receiving and storing by the cloud server, the conversion can adopt an algorithm consistent with the cloud server, so that the uploaded file name does not need to be processed after the file is uploaded to the cloud server, and resources and time can be saved. Of course, in other embodiments, other algorithms distinct from the cloud server may be used for the conversion.
By generating the uploading file name, the name of the file to be uploaded on the cloud server is the uploading file name, the problem that in the prior art, the name length of the file to be uploaded which directly uses the original file name is too long when the URL is decoded, so that the cloud server is inconvenient to store is solved, and the independence of the files to be uploaded can be guaranteed by the uploading file name.
Step S205: and establishing a mapping relation between the original file name of each file to be uploaded and the uploaded file name, wherein the mapping relation is used for restoring the corresponding original file name according to the uploaded file name of the downloaded file to be uploaded after the file to be uploaded is downloaded.
In order to maintain file independence, the original file names of the files to be uploaded are subjected to obfuscation operation, and upload file names are generated. In order to facilitate the use of the files by users, a mapping relation between the original file name of each file to be uploaded and the name of the uploaded file is established. Therefore, after the user downloads the file, the uploaded file name can be mapped to the original file name, the uploaded file name is generated by confusing the original file name of the file to be uploaded in the previous step, and the uploaded file name is long, complex and bad in ideographical property after being processed in a normal situation, which causes obstacles for the user to search and use the file. In order to solve the problem, a mapping relation between the original file name and the uploaded file name is established so that the uploaded file name can be replaced to the original file name after a user downloads a file, and the user can conveniently search and use the file.
Step S206: and constructing an uploading object corresponding to each file to be uploaded according to the generated uploading file name of each file to be uploaded.
Because the server only supports single file uploading operation, when the file list to be uploaded comprises two or more files to be uploaded, the corresponding uploading object is constructed according to the uploading file name of the file to be uploaded, so that the uploading operation can be carried out on each uploading object in the following. In this embodiment, a corresponding upload object is constructed for each file to be uploaded.
The uploading object is used for indicating the target of the uploading operation. The upload object may include an upload file name, an upload sequence identifier, a file type, a file size, and the like of the corresponding file to be uploaded. The uploading sequence identifier is used for uploading sequence of each file to be uploaded when the file list to be uploaded comprises a plurality of files to be uploaded.
Specifically, the process of constructing the upload object is as follows:
setting an uploading sequence identifier and/or an uploading state identifier for each file to be uploaded, wherein the uploading state identifier is used for indicating whether the current file to be uploaded is uploaded or not; and generating an uploading object corresponding to each file to be uploaded according to the uploading sequence identifier and/or the uploading state identifier corresponding to each file to be uploaded and the name of the uploading file.
By setting the uploading sequence identifier in the uploading object, each uploading operation can be distinguished according to different uploading sequence identifiers when a plurality of uploading operations are carried out simultaneously, and the problem that the uploading results are not returned in sequence (the large files are returned slowly, the sequence of the acquired files is not correct) due to different sizes of the files to be uploaded is solved.
Step S207: and calling a file checking function, and sequentially carrying out normative checking on the files to be uploaded corresponding to each uploading object according to the uploading sequence identifier in each uploading object.
After the upload object is constructed and before the file is uploaded, in order to ensure the uploading success rate and the normalization of each file to be uploaded, a file verification function (e.g., a beforeUpload function) may be called to verify each file to be uploaded.
Wherein, the normative check includes but is not limited to checking the file format, the file type, the file size, the creation time, and the like. For example, it is checked whether each file to be uploaded exceeds a limited file size, whether the file type of the uploaded file does not meet the specification, and the like. The file sizes defined by different types of files to be uploaded can be the same or different.
Because the file list to be uploaded, namely the Filelist file, is obtained during batch uploading, whether each file to be uploaded in the file list to be uploaded meets the uploading requirement can be further determined through a file check function before the files are uploaded.
Alternatively, the file check function may be a hook function. The hook function is a function for message processing, and by setting a hook, an application program can filter all messages and events at a system level and access messages which cannot be accessed under normal conditions. The essence of a hook is a program that handles system messages, which are put on the system through system calls. In this embodiment, the user can perform verification before uploading through the hook function, and can distinguish each file to be uploaded through the uploading sequence identifier of the uploading object. The file checking function may return information of a single file (file) or information of each file in a file list (fileList) as well as a checking result as needed for a user to view and modify.
Step S208: and uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
In a feasible manner, when uploading files, the files to be uploaded can be uploaded one by one according to the sequence indicated by the uploading sequence identifier of the uploading object.
The uploading object comprises the uploading sequence identifier, so that the situation that the sequence of the uploading result of the files returned by the cloud server is different from the uploading sequence of the files due to different sizes of the files to be uploaded can be avoided, the uploading smoothness during batch uploading of the files is ensured, the uploading quality is ensured, and the situation that the uploading completion result is obtained when a certain file is not uploaded completely is avoided.
For example, in a possible manner, step S208 specifically includes:
and determining the uploading sequence of each uploading object according to the constructed uploading sequence identifier in each uploading object. And sequentially uploading the files to be uploaded corresponding to the uploading objects according to the uploading sequence.
For example, if the upload order is identified as 1, 2, 3, 4 … … in order. And according to the sequence indicated by the uploading sequence identifier, determining that the uploading object with the uploading sequence identifier 1 is the uploading object corresponding to the current uploading operation, and further determining the file to be uploaded corresponding to the uploading object to perform the uploading operation. After the file to be uploaded corresponding to the uploading object with the uploading sequence identifier 1 is uploaded, the uploading object with the uploading sequence identifier 2 can be continuously determined to be the uploading object corresponding to the current uploading operation, the uploading operation is performed on the file to be uploaded corresponding to the uploading object, and the process is circulated until all the uploading sequence identifiers are traversed. Therefore, a plurality of uploading operations can be executed in parallel, so that batch uploading is realized, and the uploading time is saved.
Of course, in other embodiments, the uploading operation may also be performed without the order of the uploading order identifier, and the uploading order identifier is only used to distinguish the uploading operations. Compared with the prior art, the uploading operation is carried out according to the sequence indicated by the uploading sequence identifier, and the sequence of each uploading operation is consistent with the uploading sequence identifier, so that the uploading operation is simpler and more convenient, and the control on each uploading operation is more convenient.
When the uploading operation is performed on the plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object, the method may further include: and acquiring feedback information corresponding to each uploading operation, and determining the uploading state identifier of the file to be uploaded corresponding to each uploading object according to the feedback information.
It should be noted that the upload state identifier may indicate whether the corresponding file to be uploaded has been uploaded through the upload progress; whether the file to be uploaded has been uploaded or not can also be indicated by other means, for example, by indication of "not uploaded", "uploading in progress", and "uploaded", and the like.
For example, the uploading status flag is "not uploaded" before the files to be uploaded corresponding to the respective uploading objects are sequentially uploaded according to the uploading order. After the file to be uploaded is uploaded, the server can transmit feedback information corresponding to the uploading operation to the client at regular time, and the client can determine the uploading state identifier of the corresponding file to be uploaded according to the feedback information.
For example, before the uploading operation is performed, the uploading state is identified as that the file to be uploaded is not uploaded.
If the feedback information indicates that part of the files to be uploaded are received, the uploading state identifier can be determined to indicate that the files to be uploaded are uploaded; or the uploading state identifier indicates that the file to be uploaded is in uploading by indicating the specific uploading percentage.
If the feedback information indicates that the file to be uploaded is received completely, it can be determined that the uploading state identifier indicates that the file to be uploaded is uploaded.
Because the corresponding uploading object is constructed for each file to be uploaded in batch uploading, and each uploading object has an independent uploading sequence identifier, the problem that uploading results are not returned in sequence (the large files are returned slowly, so that the sequence of obtaining the files is not correct) due to different sizes of the files to be uploaded is solved.
In one possible approach, each upload operation specifically includes:
and carrying out blocking operation on the file to be uploaded to obtain a plurality of file blocks, wherein each file block is provided with an independent block identifier to distinguish each file block. And uploading the file blocks of the file to be uploaded one by one according to the sequence of the block identifiers. Each file block obtains checkpoint information after being uploaded, and the checkpoint information includes corresponding file information to be uploaded (such as corresponding uploading sequence identifier, file type, file size, and the like), uploading percentage (percentage of the file block in the whole file to be uploaded), and block identifier.
The file is partitioned, and each file block can obtain the checkpoint information after being uploaded, so that the breakpoint resume function can be supported in the uploading process of the file to be uploaded. When the file uploading fails due to the interruption of midway transmission caused by an accident, the uploading percentage and the block identifier of the corresponding file to be uploaded can be determined according to the detection point information, so that the position of the breakpoint can be known, and the uploading is started at the breakpoint.
For the convenience of the user, in one possible approach, breakpoint resume is implemented by a breakpoint resume function (onProgress function). When the breakpoint resume is needed, the user only needs to call the breakpoint resume function. The breakpoint resume function can also be a hook function, so that the breakpoint resume function is realized from the system level.
Step S209: and acquiring the uploading result of each file to be uploaded.
After uploading, the server returns an uploading result corresponding to each file to be uploaded. For example, the upload failed or the upload succeeded.
Step S210: and according to the uploading result, setting uploading result identifiers for a plurality of files to be uploaded in the file list to be uploaded.
In order to facilitate the user to know the uploading result, uploading result identifiers may be set for the multiple files to be uploaded in the file list to be uploaded according to the obtained uploading result, so as to indicate whether the uploading of each file to be uploaded in the file list to be uploaded is successful.
For example, the user may obtain a returned upload result by calling an upload completion function (onSuccess function), and may also obtain information of each file by the upload completion function as needed.
The uploading completion function can also be a hook function so as to support the file information acquisition function after the uploading is completed from the system level.
If the file is a single file, the upload completion function may enable the user to obtain resource information (denoted as res, where the resource information is an object in the cloud server and is used to indicate information of the uploaded file in the cloud server, such as a file name, a file type, a file size, and the like), a resource link (denoted as ossUrl and is used to indicate a link corresponding to the file, and the user may directly obtain the file through a browser via the link), and file original information (denoted as file and is used to indicate original information of the file, such as an original file name, original creation time, upload time, and the like) after the upload is successful.
If the uploading is in batch, the uploading completion function returns a file list besides the basic resource information, wherein the file list is an array and comprises the resource link, the file type, the file size and the uploading result identification of each uploading file. The uploading result identifier used for indicating whether the uploading is successful or not is added to each file, so that a user can conveniently determine the uploading result of each file, and can conveniently determine whether all files in a complete file list to be uploaded are successfully uploaded or not.
If a file to be uploaded fails to be uploaded exists, information of the failed file can be acquired by calling an error handling function (an oneror function, which may also be a hook function), and the failed file can be processed, for example, information of the failed file can be fed back.
For batch uploading, the error processing function may determine a failed file in the batch uploading according to the uploading result identifier and the uploading sequence identifier, and return information of the failed file to give good feedback information to the user.
According to the requirement, in order to facilitate a user to operate a file to be uploaded or a file in the cloud server, the file uploading method may further include a display list function (a showFilelist function, which may be a hook function) and a rewrite function (an overwrite function, which may be a hook function).
The display list function is used for opening or closing file list display. The duplicate function can achieve the effect that the same file can be uploaded and can be covered, so that the waste of the space of the cloud server is reduced.
On one hand, the file uploading method constructs the corresponding uploading object according to the uploading file name of each file to be uploaded, and uploads each file to be uploaded according to the uploading object, so that batch uploading operation of each file to be uploaded in the file list to be uploaded can be realized, a cloud server user is more convenient in file uploading, and the problem that cloud service can only upload a single file in the prior art is solved.
On the other hand, after the file uploading method obtains the file list to be uploaded comprising a plurality of files to be uploaded, confusion operation is carried out on the original file names of the files to be uploaded in the file list to be uploaded so as to generate corresponding uploading file names, the uploading file names of the files to be uploaded keep independence, the independence of the files after the files are uploaded to the cloud server is guaranteed, and the situation that the files are mistakenly covered due to the existence of duplicate-name files is avoided.
In addition, the scheme for uploading the file through the virtual DOM component of the embodiment solves the problems that the development complexity and the efficiency are low and the file uploading needs to be supported by changing the back end in the prior art due to the fact that a real DOM is adopted.
EXAMPLE III
According to an embodiment of the present invention, there is provided a computer storage medium storing: the method comprises the steps of obtaining a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded; the command is used for performing confusion operation on the original file name of each file to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded; the instruction is used for constructing an uploading object corresponding to each file to be uploaded according to the generated uploading file name of each file to be uploaded; and the instruction is used for uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
Optionally, the preset obfuscation parameter includes an operation time for performing an obfuscation operation on an original filename of the current file to be uploaded.
Optionally, the computer storage medium further comprises: and after the corresponding uploading file name of each file to be uploaded is generated, establishing a mapping relation between the original file name of each file to be uploaded and the uploading file name, wherein the mapping relation is used for restoring the corresponding original file name according to the downloaded uploading file name of the file to be uploaded after the file to be uploaded is downloaded.
Optionally, the instruction for constructing an upload object corresponding to each to-be-uploaded file according to the generated upload file name of each to-be-uploaded file includes: the file uploading system comprises an uploading sequence identifier and/or an uploading state identifier, wherein the uploading sequence identifier and/or the uploading state identifier are used for setting an uploading sequence identifier and/or an uploading state identifier for each file to be uploaded, and the uploading state identifier is used for indicating whether the current file to be uploaded is uploaded or not; and the instruction is used for generating an uploading object corresponding to each file to be uploaded according to the uploading sequence identifier and/or the uploading state identifier corresponding to each file to be uploaded and the name of the uploading file.
Optionally, the computer storage medium further includes an instruction, configured to, after an upload object corresponding to each of the files to be uploaded is constructed according to the generated upload file name of each of the files to be uploaded, call a file verification function, and sequentially perform a normative verification on the files to be uploaded corresponding to each of the upload objects according to the upload sequence identifier in each of the upload objects.
Optionally, the file check function is a hook function.
Optionally, the instruction for performing an upload operation on a plurality of files to be uploaded in the file list to be uploaded according to the constructed upload object includes: instructions for determining the uploading sequence of the files to be uploaded corresponding to each uploading object according to the constructed uploading sequence identification in each uploading object; and the instruction is used for sequentially uploading the files to be uploaded corresponding to the uploaded objects according to the uploading sequence.
Optionally, the instruction for performing an upload operation on a plurality of files to be uploaded in the file list to be uploaded according to the constructed upload object further includes: and the instruction is used for acquiring feedback information corresponding to each uploading operation and determining the uploading state identifier of the file to be uploaded corresponding to each uploading object according to the feedback information.
Optionally, the computer storage medium further includes a function of acquiring an upload result of each to-be-uploaded file after the upload operation is performed on the to-be-uploaded files in the to-be-uploaded file list according to the constructed upload object; and setting an instruction of uploading result identification for a plurality of files to be uploaded in the file list to be uploaded according to the uploading result.
Optionally, the instruction for acquiring the list of files to be uploaded includes: and the instruction is used for acquiring the list of the files to be uploaded according to the set batch file uploading identification.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the file upload methods described herein. Further, when a general-purpose computer accesses code for implementing the file upload method illustrated herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the file upload method illustrated herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims (11)

1. A file uploading method is characterized by comprising the following steps:
acquiring a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded;
performing confusion operation on the original file name of each file to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded;
according to the generated uploading file name of each file to be uploaded, constructing an uploading object corresponding to each file to be uploaded;
and uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
2. The method according to claim 1, wherein the preset obfuscation parameter comprises an operation time for performing an obfuscation operation on an original file name of a file to be uploaded currently.
3. The method according to claim 1, wherein after the generating of the uploading file name of each corresponding file to be uploaded, the method further comprises:
and establishing a mapping relation between the original file name of each file to be uploaded and the uploaded file name, wherein the mapping relation is used for restoring the corresponding original file name according to the downloaded uploaded file name of the file to be uploaded after the file to be uploaded is downloaded.
4. The method according to any one of claims 1 to 3, wherein constructing an upload object corresponding to each of the files to be uploaded according to the generated upload file name of each of the files to be uploaded comprises:
setting an uploading sequence identifier and/or an uploading state identifier for each file to be uploaded, wherein the uploading state identifier is used for indicating whether the current file to be uploaded is uploaded or not;
and generating an uploading object corresponding to each file to be uploaded according to the uploading sequence identifier and/or the uploading state identifier corresponding to each file to be uploaded and the name of the uploading file.
5. The method according to claim 4, wherein after the constructing of the upload object corresponding to each of the files to be uploaded according to the generated upload file name of each of the files to be uploaded, the method further comprises:
and calling a file verification function, and sequentially performing normative verification on the files to be uploaded corresponding to the uploaded objects according to the uploading sequence identification in the uploaded objects.
6. The method of claim 5, wherein the file check function is a hook function.
7. The method according to claim 4, wherein the uploading the plurality of files to be uploaded in the list of files to be uploaded according to the constructed uploading object comprises:
determining the uploading sequence of the files to be uploaded corresponding to each uploading object according to the constructed uploading sequence identification in each uploading object;
and sequentially uploading the files to be uploaded corresponding to the uploaded objects according to the uploading sequence.
8. The method according to claim 4, wherein the uploading the plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object further comprises:
and acquiring feedback information corresponding to each uploading operation, and determining the uploading state identifier of the file to be uploaded corresponding to each uploading object according to the feedback information.
9. The method according to claim 1, wherein after the uploading operation is performed on the plurality of files to be uploaded in the list of files to be uploaded according to the constructed uploading object, the method further comprises:
acquiring an uploading result of each file to be uploaded;
and setting uploading result identifications for the plurality of files to be uploaded in the file list to be uploaded according to the uploading result.
10. The method according to claim 1, wherein the obtaining the list of files to be uploaded comprises:
and acquiring a list of files to be uploaded according to the set batch file uploading identification.
11. A computer storage medium, the computer storage medium having stored thereon: the method comprises the steps of obtaining a file list to be uploaded, wherein the file list to be uploaded comprises original file names of a plurality of files to be uploaded; the command is used for performing confusion operation on the original file name of each file to be uploaded by using preset confusion parameters to generate corresponding uploading file names of the files to be uploaded; the instruction is used for constructing an uploading object corresponding to each file to be uploaded according to the generated uploading file name of each file to be uploaded; and the instruction is used for uploading a plurality of files to be uploaded in the file list to be uploaded according to the constructed uploading object.
CN201810842589.8A 2018-07-27 2018-07-27 File uploading method and computer storage medium Pending CN110769016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810842589.8A CN110769016A (en) 2018-07-27 2018-07-27 File uploading method and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810842589.8A CN110769016A (en) 2018-07-27 2018-07-27 File uploading method and computer storage medium

Publications (1)

Publication Number Publication Date
CN110769016A true CN110769016A (en) 2020-02-07

Family

ID=69327861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810842589.8A Pending CN110769016A (en) 2018-07-27 2018-07-27 File uploading method and computer storage medium

Country Status (1)

Country Link
CN (1) CN110769016A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111355793A (en) * 2020-02-26 2020-06-30 山东爱城市网信息技术有限公司 Large file uploading method based on HTML5 and Python
CN112835864A (en) * 2021-02-03 2021-05-25 北京联创信安科技股份有限公司 File storage method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291195A (en) * 2008-05-23 2008-10-22 中兴通讯股份有限公司 File downloading method, system and terminal realizing breaker point continuous transmission
CN101465872A (en) * 2007-12-17 2009-06-24 新奥特(北京)视频技术有限公司 Method for transmitting and managing document
CN105007322A (en) * 2015-07-21 2015-10-28 陈丹 File transmission method and system
CN105590064A (en) * 2015-12-14 2016-05-18 中国建设银行股份有限公司 File processing method, file processing device and file server
CN106445665A (en) * 2016-09-19 2017-02-22 武汉斗鱼网络科技有限公司 Method and tool for system file downloading applied to android system
CN106487868A (en) * 2016-05-30 2017-03-08 深圳市美贝壳科技有限公司 The method that User Defined uploads
CN107566540A (en) * 2017-10-31 2018-01-09 云宏信息科技股份有限公司 Big document breakpoint transmission method, apparatus and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465872A (en) * 2007-12-17 2009-06-24 新奥特(北京)视频技术有限公司 Method for transmitting and managing document
CN101291195A (en) * 2008-05-23 2008-10-22 中兴通讯股份有限公司 File downloading method, system and terminal realizing breaker point continuous transmission
CN105007322A (en) * 2015-07-21 2015-10-28 陈丹 File transmission method and system
CN105590064A (en) * 2015-12-14 2016-05-18 中国建设银行股份有限公司 File processing method, file processing device and file server
CN106487868A (en) * 2016-05-30 2017-03-08 深圳市美贝壳科技有限公司 The method that User Defined uploads
CN106445665A (en) * 2016-09-19 2017-02-22 武汉斗鱼网络科技有限公司 Method and tool for system file downloading applied to android system
CN107566540A (en) * 2017-10-31 2018-01-09 云宏信息科技股份有限公司 Big document breakpoint transmission method, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
尘光掠影: "JFinal框架单文件、多文件上传详解", 《CSDN,HTTPS://BLOG.CSDN.NET/ALAN_LIUYUE/ARTICLE/DETAILS/79386540》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111355793A (en) * 2020-02-26 2020-06-30 山东爱城市网信息技术有限公司 Large file uploading method based on HTML5 and Python
CN112835864A (en) * 2021-02-03 2021-05-25 北京联创信安科技股份有限公司 File storage method, device, equipment and storage medium
CN112835864B (en) * 2021-02-03 2024-02-20 北京联创信安科技股份有限公司 File storage method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109743315B (en) Behavior identification method, behavior identification device, behavior identification equipment and readable storage medium for website
CN107832329B (en) Page resource obtaining method and terminal equipment
CN107733847B (en) Method and device for platform login website, computer equipment and readable storage medium
CN109391673B (en) Method, system and terminal equipment for managing update file
EP2989543B1 (en) Method and device for updating client
CN105871587A (en) Log uploading method and device
CN103607385A (en) Method and apparatus for security detection based on browser
CN107528858B (en) Login method, device and equipment based on webpage and storage medium
CN107104924B (en) Verification method and device for website backdoor file
CN104348919A (en) Method and device for downloading file and browser
US10284561B2 (en) Method and server for providing image captcha
CN111262822B (en) File storage method, device, block link point and system
CN109412896B (en) Method and device for testing uploading function, computer equipment and storage medium
CN106709341A (en) Virus processing method and device capable of aiming at file package
CN105554137A (en) Backup system and method
CN105554136B (en) Backup Data restoring method, apparatus and system
CN111970236A (en) Cross-network data transmission method and device
CN110769016A (en) File uploading method and computer storage medium
CN106203179B (en) A kind of completeness check system and method for pair of file
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN115297104B (en) File uploading method and device, electronic equipment and storage medium
CN112995143B (en) Safety reporting method, device, equipment and medium based on mail system
CN107623710A (en) A kind of file uploading method and terminal
CN107465744B (en) Data downloading control method and system
CN110825406A (en) Software upgrading method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200207

RJ01 Rejection of invention patent application after publication