plupload icon indicating copy to clipboard operation
plupload copied to clipboard

documentation request: c# MVC example with new beta version

Open pilavdzic opened this issue 13 years ago • 2 comments

Hello,

I succeeded in getting plupload to work with my c# MVC server side by putting this file in my upload controller like this:

    [HttpPost]
             public ActionResult UploadFile(string name, int chunk = 0, int chunks = 0, string param1="0") {
                 var fileUpload = Request.Files[0];
                 var uploadPath = "c://files//";

        using (var fs = new FileStream(Path.Combine(uploadPath, name), chunk == 0 ? FileMode.Create : FileMode.Append)) {
            var buffer = new byte[fileUpload.InputStream.Length];
            fileUpload.InputStream.Read(buffer, 0, buffer.Length);
            fs.Write(buffer, 0, buffer.Length);
        }

        if (chunk == chunks - 1 || chunks==0) { //last chunk, file upload is complete
            //copy and save it here 
        }

        return Json(new { message = "chunk uploaded", name = name });
    }

However, this new beta says it does not use chunk or chunks anymore and I don't understand how to change my server code so that it works with the new beta.

Can someone please suggest and post and example of how this is supposed to work now?

This would be greatly appreciated.

Thanks!

pilavdzic avatar Jul 10 '13 19:07 pilavdzic

New beta uses chunk and chunks, you've probably read about it on the forum. Need to update that thread - it's outdated. We decided to keep the format same in the end.

jayarjo avatar Jul 13 '13 06:07 jayarjo

great news, thanks, so I don't need to change my code. I like the chunks thing.

On Sat, Jul 13, 2013 at 2:08 AM, Davit Barbakadze [email protected]:

New beta uses chunk and chunks, you've probably read about it on the forum. Need to update that thread - it's outdated. We decided to keep the format same in the end.

— Reply to this email directly or view it on GitHubhttps://github.com/moxiecode/plupload/issues/833#issuecomment-20915398 .

pilavdzic avatar Jul 13 '13 15:07 pilavdzic