- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Ajax Image Upload
I just read the awesome article about uploading images and getting a preview at the same time.
But, I can’t find where the AjaxUpload() is implemented? Is it outdated? The article refers to valums ajax uploader, but there they use the
var uploader = new qq.FileUploader()
and not the
new AjaxUpload()
This is my code in the js-file
jQuery.noConflict();
jQuery(document).ready(function($){
var thumb = $("#thumb");
var preview = $("#preview");
var uploadForm = $("#upload-form");
new AjaxUpload('upload-image', {
action: uploadForm.attr('action'),
name: 'image',
onSubmit: function(file, extension){
preview.addClass('loading');
},
onComplete: function(file, response){
thumb.load(function(){
preview.removeClass('loading');
thumb.unbind();
});
thumb.attr('src', response);
}
});
});
and this is the html
The uploaad.php looks like this
echo "images/preview2.png";
fileuploader.js is the one from valums ajax uploader.
I’m doing this just to test if it works at all, but it doesn’t seem to. Nothing happens when I select a new file.
So I guess my main question is: Is the AjaxUpload()-function outdated and should something else be used instead? Or do I create it some place else myself? I didn’t find a good explanation for it ^^
Thanks!
Aaaaaa! I found it in the readme! The AjaxUpload is outdated, and the qq.FileUploader is the one to go with. Now I just have to modify it so it works with the qq.FileUploader instead!
Can you share your updated codes? I really need it. Here’s my email address: [email protected]. Thank you.