<div class="hideAfterSuccess">
<label for="avatar">Upload an Avatar :</label>
<input type="file" name="avatar" id="avatar" />
</div>
and below is the jquery that has to pass image location to a php function in another file (parsePortal.php). am able to pass other kinds of data o the file but the image failed. i thought since it posts the location string of the image, i would be able to use $_FILES[$_POST[‘image’]][‘name’] and then upload the image. i have tried the web, surely, didn’t find what i needed.
$(function(){
var imageLoc = $('avatar').val();
var url = "parsePortal.php";
$.post(url, {
status : "getimage",
image : "imageLoc"
}, function(result){
});
});
i successfully did it using the jquery forms plugin.
this means it sent the whole path from which i got the the file name and printed it out. THANKS TO YOU VIC, there is no way i c’d have done this without this kind of help.
here is the javascript.
and here is the html
and here is the php