Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIkit CSS Drag/Drop file upload component

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>
like image 581
Matt McAlister Avatar asked Nov 10 '22 09:11

Matt McAlister


1 Answers

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.

like image 180
di3sel Avatar answered Nov 14 '22 23:11

di3sel