I am working on an implementation of FineUploader. A special request is to create thumbnails on the client side and then upload the files with the original image upload .
I have an implementation that works on FF, but doesn't seem to work on iOS. It looks like this:
var uploader = new qq.FineUploaderBasic({ button: document.getElementById(buttonID), request: { endpoint: '/up/load/a/' + $('section#ajax-viewport').data('albumid') }, callbacks: { onSubmit: function(id, fileName) {
This code calls the function:
function ThumbDown(file, id, dimension, fileName) { var reader = new FileReader(); reader.onload = function(e) { var img = document.createElement("img"); img.onload = function (ev) { var thumbnailDimensions;
Finally, Thumbnail boots with a dumb ajax call:
function uploadThumbnail (base64encodedString, id, fileName) { $.post('/up/thumb', { img : base64encodedString, id: id, fileName: fileName }, function(data) {}); }
My questions:
1) I currently have two downloads: one for the image of the mother and the other for the thumbnails. I would like to combine this in a single FineUploader call. However, I see no way to do this because of the asynchronous nature of the thumbnail creation.
Am I missing something? Is it possible to reduce this to one FineUploader call?
2) This code loads base64-encoded thumbnails. I would like to upload a thumbnail as an image (or as a blob ?). Perhaps following this recipe of Jeremy Banks. Will this work with FineUploader?
3) Are there any other FineUploader options / methods that I missed, but should I use?
Any help, as always, is greatly appreciated.