<div class="hideAfterSuccess">
<label for="avatar">Upload an Avatar :</label>
<input type="file" name="avatar" id="avatar" />
</div>
and below is jquery, which should pass the image location to php function in another file (parsePortal.php). I can transfer other kinds of data to the file, but the image failed. I thought, since it is posting the image location string, I could use $ _FILES [$ _ POST ['image]] [' name '] and then upload the image. i tried internet, of course didn't find what i need.
$(function(){
var imageLoc = $('avatar').val();
var url = "parsePortal.php";
$.post(url, {
status : "getimage",
image : "imageLoc"
}, function(result){
});
});
jquery
post
image
back
avatar
Busker McGreen Brian
source
to share