The jQuery File Upload plugin does NOT currently display the selected file. Does anyone know how I can troubleshoot this issue?
I've implemented 'custom' templates (see below); note I do not need to display previously uploaded material, hence there is no download template.
I have already checked (via logging) that the add
callback is being called and that the uploadTemplate
function is being called and returning expected values -- for some reason those values are simply not being appended to the presentation table.
$('#fileupload').fileupload(
acceptFileTypes: /(\.|\/)(gif)$/i
uploadTemplateId: null
downloadTemplateId: null
uploadTemplate: (obj) ->
rows = $()
$.each(obj.files, (idx, file) ->
temp = "<tr class='template-upload fade'><td class='preview'><span class='fade'></span></td><td class='name'></td>'<td class='size'></td>"
if (file.error)
temp += "<td class='error' colspan='2'></td>"
else
temp += "<td><div class='progress'><div class='bar' style='width:0%;'></div></div></td><td class='start'><button>Start</button></td>"
temp += "<td class='cancel'><button>Cancel</button></td></tr>"
row = $(temp)
row.find('.name').text(file.name)
row.find('.size').text(obj.formatFileSize(file.size))
rows = rows.add(row)
)
return rows
downloadTemplate: ->
return $()
)
UPDATE 10/16/2012 I added the following to the initialization of fileupload:
process: [{action: 'load', fileTypes: /^image\/(gif|jpeg|png)$/, maxFileSize: 2000000}, {action: 'resize', maxWidth: 1920, maxHeight: 1200, minWidth: 800, minHeight: 600}, {action: 'save'}]
Which does initiate the attempt to load the image, but unfortunately, the attempt results in the following error. Does anyone know what is the cause and/or how to solve it?
Uncaught TypeError: undefined (loadImage) is not a function jquery.fileupload-fp.js:87