好的上传者:初始文件列表不工作
Fine uploader : Initial File List not working
我正在使用 fine uploader,我想在页面加载时显示 fine uploader 中预上传的图片。
我做了一些研究并在这里找到了一个潜在的解决方案:
但是,我不知道如何实现它,下面是我的代码(到目前为止我尝试过的代码):
var manualUploader = new qq.FineUploader({
element: document.getElementById('fine-uploader-manual-trigger'),
template: 'qq-template-manual-trigger',
request: {
endpoint: ''
},
thumbnails: {
placeholders: {
waitingPath: 'images/waiting-generic.png',
notAvailablePath: 'images/not_available-generic.png'
}
},
validation: {
// allowedExtensions: ['jpeg', 'jpg', 'txt'],
itemLimit: 6,
// sizeLimit: 51200 // 50 kB = 50 * 1024 bytes
},
session: {
endpoint: 'http://localhost/spacebar/img/advertisements/advertisement_0_1467805607_138.png'
},
autoUpload: false,
debug: true
});
以下是我在控制台中的回复
并且还在控制台中收到此 [Fine Uploader 5.10.0] Problem parsing session response: JSON.parse: unexpected character at line 1 column 1 of the JSON data
错误
请帮忙指导如何实现
问题出在您的 session.endpoint
上。 Fine Uploader 将在启动时向此端点发送 GET 请求,期望 JSON 响应包含有关要填充的初始文件列表的数据.
If you have specified a value for the session.endpoint option, Fine
Uploader will send a GET request to your endpoint on startup (and
optionally when the instance is reset). The response to this request
must be valid JSON. More specifically, it must be a JSON array
containing Objects for each file to be fed into the uploader.
详情请参考http://docs.fineuploader.com/branch/master/features/session.html。
我正在使用 fine uploader,我想在页面加载时显示 fine uploader 中预上传的图片。
我做了一些研究并在这里找到了一个潜在的解决方案:
但是,我不知道如何实现它,下面是我的代码(到目前为止我尝试过的代码):
var manualUploader = new qq.FineUploader({
element: document.getElementById('fine-uploader-manual-trigger'),
template: 'qq-template-manual-trigger',
request: {
endpoint: ''
},
thumbnails: {
placeholders: {
waitingPath: 'images/waiting-generic.png',
notAvailablePath: 'images/not_available-generic.png'
}
},
validation: {
// allowedExtensions: ['jpeg', 'jpg', 'txt'],
itemLimit: 6,
// sizeLimit: 51200 // 50 kB = 50 * 1024 bytes
},
session: {
endpoint: 'http://localhost/spacebar/img/advertisements/advertisement_0_1467805607_138.png'
},
autoUpload: false,
debug: true
});
以下是我在控制台中的回复
并且还在控制台中收到此 [Fine Uploader 5.10.0] Problem parsing session response: JSON.parse: unexpected character at line 1 column 1 of the JSON data
错误
请帮忙指导如何实现
问题出在您的 session.endpoint
上。 Fine Uploader 将在启动时向此端点发送 GET 请求,期望 JSON 响应包含有关要填充的初始文件列表的数据.
If you have specified a value for the session.endpoint option, Fine Uploader will send a GET request to your endpoint on startup (and optionally when the instance is reset). The response to this request must be valid JSON. More specifically, it must be a JSON array containing Objects for each file to be fed into the uploader.
详情请参考http://docs.fineuploader.com/branch/master/features/session.html。