hai friends,
iam jaison justus, i need a help for uploading a file using jquery ajax. i dont need to use any jquery upload plugin.
the code is
$(document).ready(function(){
$('#addAlbum').click(function(){
alert('click test done!!!!');
details = $('#albumname').val();
details += ':';
details += $('#artistname').val();
details += ':';
details += $('#ratingval').val();
details += ':';
details += $('#image').val();
alert(details);
uploadDetails(details,$('#image').val());
});
});
function getElement(result) {
alert('done' + ' ' + result);
}
/*detail:details,image:imageFile*/
function uploadDetails(details,imageFile) {
$.ajax({
url:'uploadAlbum.php',
type: 'POST',
data: { detail:details,
image:imageFile
},
success: function(result){alert(result);}
});
}
this code is not working
please help with the jquery upload
Moderator: General Moderators
-
jaisonjustus
- Forum Newbie
- Posts: 3
- Joined: Thu Nov 05, 2009 10:52 pm
Re: please help with the jquery upload
I assume $('#image') is an input with type "file".
Short answer is you can't do it and you need to use a plugin.
Short answer is you can't do it and you need to use a plugin.
Re: please help with the jquery upload
You could just post the form, couldn't you? As in trigger the submit() action?