Iam trying to create Ajax-Image Upload. Inorder to move image using move_uploaded_file()
i need the name
and tmp_name
.
Is there any functions in javascript to get the filename and temporary file name like the following on php.
$n=$_FILES["filefield"]["name"];
$t=$_FILES["filefield"]["tmp_name"];
I have the image name on the variable $newTidImg[1]
. Can i assign like following
$n=$_FILES[$newTidImg[1]]["name"];
$t=$_FILES[$newTidImg[1]]["tmp_name"];
The following function used for ajax post which passes id and image name to changeImageAjx.php
function ajximgupls(trid,imgnam)
var tridImgval = trid+','+imgnam;
jQuery.ajax({
type: 'POST',
url: 'changeImageAjx.php',
data: 'urlTidimgs='+ tridImgval,
cache: false,
success: function(ret)
Thanks in advance.