File uploading method and device based on JavaScript
A file upload and file technology, applied in the computer field, can solve the problems of increasing user waiting time, inconvenient use, waste of broadband, etc., and achieve the effect of saving bandwidth, saving time, and high security
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0040] The present invention provides a JavaScript-based file uploading method, which requires the cooperation of a file server and a Web page for the implementation of browser-based second transfer. When a user uploads a file using a browser, the file server divides the file into blocks of fixed size, and calculates and saves the file fingerprint of each block. If the file has been uploaded before, there is no need to upload it again, and the upload is completed immediately, which can save the time for the browser to upload the file and save the bandwidth.
[0041] like figure 1 As shown, it is a flow chart of a JavaScript file upload technology of the present invention, and the specific implementation steps of the present invention are as follows:
[0042] Step S1 Select the file to be uploaded
[0043] The user opens the upload page in the browser, selects the file to be uploaded in the corresponding folder, and clicks upload.
[0044] Step S2: Block the file by JavaScri...
Embodiment 2
[0066] Based on the same inventive concept, the present invention also provides a JavaScript-based file uploading device, such as figure 2 As shown, it is a system block diagram of the apparatus of the present invention. The uploading device includes: an uploading unit 1 , a block unit 2 , a computing unit 3 , and a verification unit 4 .
[0067] The uploading unit 1 is used to select files to be uploaded. The user opens the upload interface in the browser, selects the file to be uploaded in the corresponding folder, and clicks upload.
[0068] The chunking unit 2 chunks the uploaded file through JavaScript. Use JavaScriptFileReader to read the file content in blocks. The core idea of the block is: take the size of 100Mb as an example, block the file larger than 100Mb, otherwise read the whole block.
[0069] Selecting an appropriate file block size is extremely important for the file uploading work. If the block size is too large or too small, the upload efficiency will...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


