Question

I am using the jquery uploader from here.

This is my button:

<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
    <i class="glyphicon glyphicon-plus"></i>
    <span>إضافة صورة</span>
    <!-- The file input field used as target for the file upload widget -->
    <input id="fileupload" type="file" accept="image/png" name="files[]">
</span>
<br>
<small>الحد الأقصى لحجم الملف هو 2.5 ميجابايت</small><br>
</td>
<td align="left" valign="middle">
<!-- The global progress bar -->
<div id="progress" class="progress" style="width: 300px">
    <div class="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->

and this is my jquery:

/*jslint unparam: true */
/*global window, $ */
$(function () {
    'use strict';
    // Change this to the location of your server-side upload handler:
    var url = window.location.hostname === 'blueimp.github.io' ?
                '//jquery-file-upload.appspot.com/' : 'jqueryupload/server/php/articlemedia/';
    $('#fileupload').fileupload({
        url: url,
        dataType: 'json',
        maxFileSize: 2500000,
        done: function (e, data) {
            $.each(data.result.files, function (index, file) {
                // $('<p/>').text(file.name).appendTo('#files');
                console.log("file", file.url) // see what this shows.
                $("#imgLogo").attr("src", file.url);
            });
        },
        progressall: function (e, data) {
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $('#progress .progress-bar').css(
                'width',
                progress + '%'
            );
           window.location = '<?php echo $_SESSION["volow_domain_name"]; ?>memberarticlemedia?id=' + GetQueryStringValue('id');
        }
    }).prop('disabled', !$.support.fileInput)
        .parent().addClass($.support.fileInput ? undefined : 'disabled');
});

I want to know how can I add a then pass it to the UploadHandler.php so that I can process it there (add it to a database record)?

Thanks, Jassim

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top