Hi Jako and all! And thanks for your great add-on, Jako!
I ran into the following problem. I have a number of frontend-editable resources on my website and I use ajaxUpload to upload images for them. But when I hit "submit" and the form is saved ajaxUpload-ed images are saved to target directory, the ajaxUpload queue IS NOT cleared. So when I go to "edit resource" again, I see all the images I've just uploaded already in the queue ready to get uploaded once again!
I do use page-based UID for ajaxUpload so the problem is not about keeping different resources independent. The problem is about the already-uploaded images reappearing in the upload form if I go to Edit once again.
I thought it would be natural to get the queue flushed when the images are saved to target. So I added $ajaxUpload->clearValue() to AjaxUpload2Formit snippet, like this:
default :
$ajaxUpload->saveUploads($ajaxuploadTarget);
$ajaxUpload->deleteExisting($ajaxuploadTarget);
$ajaxuploadValue = $ajaxUpload->getValue($ajaxuploadFieldformat);
$hook->setValue($ajaxuploadFieldname, $ajaxuploadValue);
$ajaxUpload->clearValue();
$success = true;
The question: Is this correct enough or is it better to do it in a different way? And am I right that the queue should get flushed when images are saved to target? What do you think? Looking for an advice.