moxiecode / plupload

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.
http://www.plupload.com
GNU Affero General Public License v3.0
5.63k stars 1.42k forks source link

Example of using plupload on ASP.net MVC #54

Closed zuperboy90 closed 7 years ago

zuperboy90 commented 14 years ago

Hello

Can anybody show an complete example of hot to use plupload on asp.net mvc?

Currently i am having

    public ActionResult UploadFile()
    {
        int chunk = Request.QueryString["chunk"] != null ? int.Parse(Request.QueryString["chunk"]) : 0;
        string fileName = Request.QueryString["name"] != null ? Request.QueryString["name"] : "";

        //open a file, if our chunk is 1 or more, we should be appending to an existing file, otherwise create a new file
        FileStream fs = new FileStream(Server.MapPath("/files/" + fileName), chunk == 0 ? FileMode.Create : FileMode.Append);

        //write our input stream to a buffer
        Byte[] buffer = new Byte[Request.InputStream.Length];
        Request.InputStream.Read(buffer, 0, buffer.Length);

        //write the buffer to a file.
        fs.Write(buffer, 0, buffer.Length);
        fs.Close();

        return Json(null, JsonRequestBehavior.AllowGet);
    }

but i get error when i try to acces the filestream because file is not found...

Please help

Thanks

avel commented 14 years ago

In issue #2 ( http://github.com/moxiecode/plupload/issues#issue/2 ) there is already a link to example code: http://www.angrymonkeys.com.au/blog/2010/02/26/using-plupload-with-asp-net/

zuperboy90 commented 14 years ago

i already tryied the example from there...but is not enaugh... I just need a small tutorial of what functions need to be implemented from start to end... Just basics but a complete working one Please

tekbird commented 11 years ago

https://pluploadmvc4demo.codeplex.com

jayarjo commented 11 years ago

@tekbird maybe lacks support for chunked upload, but very nice otherwise :)

jayarjo commented 11 years ago

Here is another example: https://github.com/RickStrahl/Westwind.plUploadHandler