使用blueimp jQuery插件预先预设文件上传,而是附加它们



我正在使用此插件将文件上传到我的网站https://github.com/blueimp/jquery-file-upload

加载页面时,默认情况下,我显示所有已经上传的图像。使用此代码:

$j('#showUploadedImages').on('click', function() {
$j.ajax({
    url: '/upload/server/php-general-images/',
    dataType: 'json',
    context: $j('#fileupload')[0],
    data: 'userID=' + $j('#userID').val()
}).always(function () {
    $j(this).removeClass('fileupload-processing');
}).done(function (result) {
    $j(this).fileupload('option', 'done')
    .call(this, $j.Event('done'), {result: result});
});
});

实际行为:当我添加更多图像上传时,这些图像在列表的底部显示(使用" start"按钮,开始上传该图像(。

请求:我想显示要在列表顶部上传的图像(而不是底部(

原因:当我上传了许多映像(例如500(时,列表变长了,当我添加更多图像时,我必须滚动所有列表,直到底部要单击新图像的"开始"按钮要上传。

jquery.fileupload-ui.js文件中,将以下行更改为 true

// By default, files are appended to the files container.
// Set the following option to true, to prepend files instead:
prependFiles: true,

最新更新