简体   繁体   中英

How to upload files using Asp .net core in background process

I am working on Asp .net core. I need to upload the multiple files on one folder using dialog box which pops up when clicked on button. The uploading task must be run in background. I really don't know how to do it. Is there any way using which I can upload video in parallel, which even run after page refreshes. I have used razor views to create web page and used JavaScript for button clicked event.

You can split the file / video into parts and save it in the browser.

Example: You save a video in 20 parts, encoded in base64, search for "service_works.js" with it you can run a background script in the browser, I believe you can make some http calls too, then just send these base64 parts to your .net and there when you have all the parts you put everything together.

  1. Encode.mp4 to base64.

    Base64-encoding a Videofile in js

  2. Save parts of the base64 string to a database.

    http://html5doctor.com/introducing-web-sql-databases/

  3. Service works (where you can take the parts of the base64 string and send it to .NET)

    https://developer.mozilla.org/pt-BR/docs/Web/API/Service_Worker_API/Using_Service_Workers

  4. In .net you will be saving the parts of the string until you have all the parts, then you just have to put all the bytes together and save it in the video format, which in this case is.mp4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM