How to know when the file was uploaded 100%

0

I have a functionality of does the following:

  • Loads a video from the user's PC using C #
  • Places the video link in an src of an HTML5 using JQuery
  • The problem:

    It puts the link and shows the player, but as the video has not yet uploaded 100% nothing appears in the player. After a few seconds, pressing play will start without any problems.

    I keep the video like this:

    private void UploadWholeFile(HttpContext context, List<FilesStatus> statuses, 
                                  string pre_hash = "")
        {
            for (int i = 0; i < context.Request.Files.Count; i++)
            {
                var file = context.Request.Files[i];
    
                var fullPath = StorageRoot + pre_hash + Path.GetFileName(file.FileName);
    
    
                file.SaveAs(fullPath); // <---- GUARDO AQUI <---------------
    
                string fullName = Path.GetFileName(file.FileName);
                statuses.Add(new FilesStatus(pre_hash + fullName, file.ContentLength, 
                                              fullPath));
            }
        }
    

    How can I tell when the file has been loaded (this function saves N different files, in the context of this problem there is always only one item for the loop)?

        
    asked by anonymous 06.03.2017 / 14:52

    0 answers