5

I'm having trouble getting the UIkit upload component working in my web application. I've included the upload component JS, placeholder css and form-file css.

The code straight from the examples in the docs doesn't even work for me.(With some minor alterations)

HTML

<div id="upload-drop" class="uk-placeholder">
    <i class="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>
    <input class="uk-form-file" id="upload-select" type="file" accept="image/*">
</div>

JS

$(function(){
    var settings    = {
        action: 'app/components/Parts/upload.php'
    };

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

upload.php

<script>
    document.location.href = "/test/#/;
</script>
Matt McAlister
  • 418
  • 5
  • 15
  • I use upload component with Codeigniter, It's working like a charm. Before you get into php part, you should check your html file. Did you include all the js scripts needed, jquery, uikit, upload? (order also matters) – cssBlaster21895 Mar 31 '16 at 19:36

1 Answers1

1

I believe you can implement PHP logics from this article to work with UiKit's Javascript.

I've had the same problem, and it helped me.

di3sel
  • 2,002
  • 15
  • 24