1

(0 replies, posted in Queue Widget)

I am looking for a way to put the max upload size on 1 gb
So a maximum of 1gb from all the files together

The settings:
    $("#uploader").pluploadQueue({
                runtimes: 'html5, html4',
                url: '/Upload/Upload',
                max_file_size: '10mb',
                unique_names: true,
                multipart: true,
                multiple_queues: false,
                filters: [
                    { title: "Bestanden", extensions: "jpg,gif,png,docx" },
                ],

2

(1 replies, posted in Queue Widget)

I was wondering if it is possible instead of say which extensions can be used say which extension can not be used.

So by example i only wants that a user only can't upload .exe files is it possible to say something like: file extensions that cant be used: "exe, jpg"

The settings:

    $("#uploader").pluploadQueue({
                runtimes: 'html5, html4',
                url: '/Upload/Upload',
                max_file_size: '10mb',
                unique_names: true,
                multipart: true,
                multiple_queues: false,
                filters: [
                    { title: "Bestanden", extensions: "jpg,gif,png,docx" },
                ],

With my Plupload query i upload the files:

    $(function () {
        $("#uploader").pluploadQueue({
            runtimes: 'html5, html4',
            url: '/Home/Index',
            max_file_size: '10mb',
            unique_names: true,
            multipart: true,
            multiple_queues: false,
            filters: [
                { title: "Foto's", extensions: "jpg,gif,png" },
            ],

            preinit: {
                FileUploaded: function (up, file, response) {
                    var data = response.response; //$.parseJSON(response.response);

                    $('<input>').attr({
                        type: 'hidden',
                        name: 'fileId' + data,
                        value: data
                    }).appendTo('#uploadFinishedForm');

                    if (data.error == 1) {
                        uploader.trigger("Error", { message: "'" + data.message + "'", file: file });
                        console.log('[Error] ' + file.id + ' : ' + data.message);
                        return false;
                    }
                },

                UploadComplete: function (up, files) {
                    var $container = $('.box');
                    $container.hide();
                    var $spinner = $('#spinner');
                    $spinner.show();
                    window.setTimeout(function (form) {
                        $('#uploadFinishedForm').submit();
                    }, 2000)

                },

                Init: function (up, info) {
                    $('#uploader_container').removeAttr("title");
                }
            }
        });


        $('#uploader').submit(function (e) {
            var uploader = $('#uploader').pluploadQueue();
            if (uploader.files.length > 0) {
                uploader.bind('StateChanged', function () {
                    if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
                        $('#uploader').submit();
                    }
                });

                uploader.start();
            } else {
                $('#uploadInfo').html('');
            }

            return false;
        });
});

In my Elements i see: <input type="hidden" id="upload_count" name="upload_count" value="1">

When i use my button code it returns me nothing only null unhandled object:

   public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Upload(HttpPostedFileBase uploader_count)
        {
            System.Console.WriteLine(uploader_count.FileName);
            return View("Index");
        }

I need some help with uploading files on my server.

@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype="multipart/form-data" }))
        {
            <div id="uploader" style="width: 450px; height: 330px;">Your browser doesn't support upload.</div>
       
            <input type="submit" class="btn btn-large btn-success" value="Transfer" />
               
        }

With a hit on the submit button he needs to upload the file inside the uploader to my server but my problem is that it is always empty.

My Controller:

   public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Upload(HttpPostedFileBase file)
        {
            System.Console.WriteLine(file.FileName);
           
            return View("Index");
        }