D
D
Dokuro2015-09-14 19:21:35
UIkit
Dokuro, 2015-09-14 19:21:35

UIKIT. Uploading a file to a server with a progress bar?

I'm trying to implement as in the example: getuikit.com/docs/upload.html
My code:

<script>
            $(function(){
                var progressbar = $("#progressbar"),
                    bar         = progressbar.find('.uk-progress-bar'),
                    settings    = {
                        param: 'user_file',
                        action: 'http://dd.lo/index.php', // upload url
                        allow: '*.(jpg|gif|png)', // allow only images
                        loadstart: function() {
                            bar.css("width", "0%").text("0%");
                            progressbar.removeClass("uk-hidden");
                        },

                        progress: function(percent) {
                            percent = Math.ceil(percent);
                            bar.css("width", percent+"%").text(percent+"%");
                        },

                        allcomplete: function(response) {
                            bar.css("width", "100%").text("100%");
                            setTimeout(function(){
                                progressbar.addClass("uk-hidden");
                            }, 250);
                            
                            alert("Upload Completed")
                        }
                    };

                var select = UIkit.uploadSelect($("#upload-select"), settings),
                    drop   = UIkit.uploadDrop($("#upload-drop"), settings);
            });

        </script>

I specified param: user_file so why PHP Notice: Undefined index: user_file?
I don't understand what's wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2015-09-14
@OnYourLips

I don't understand what's wrong
Error in PHP code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question