I am trying to retrieve the file name of the file which upload has been cancelled when the user clicked on the "Cancel" button. The problem is that I believe the method I am using (var image_file_name" is not retrieving the name of that file which has been cancelled. Does anyone know a solution in able to retrieve the name of the file which has been canceled?Below is the form code and javascript function which controls the "Cancel" button:\[code\]var $fileImage = $("<form action='imageupload.php' method='post'enctype='multipart/form-data' target='upload_target' onsubmit='return startImageUpload(this);' class='imageuploadform' ><label>" + "Image File: <input name='fileImage' type='file' class='fileImage' /></label><br/><br/><label class='imagelbl'>" + "<input type='submit' name='submitImageBtn' class='sbtnimage' value='http://stackoverflow.com/questions/10561872/Upload'/> </label>" + "</p><p class='imagef1_cancel' align='center'><label>" + "<input type='button' name='imageCancel' class='imageCancel' value='http://stackoverflow.com/questions/10561872/Cancel'/></label>" + "</p><p class='listImage' align='left'></p>" +"<iframe class='upload_target' name='upload_target' src='http://stackoverflow.com/questions/10561872/#' style='width:0;height:0;border:0px;solid;#fff;'></iframe></form>")\[/code\]...\[code\] var _cancelimagecounter = cancelimagecounter; $(".imageCancel").click(function() { var image_file_name = <?php echo json_encode($image_file_name); ?>; jQuery.ajax("cancelimage.php?fileImage=" + image_file_name) .done(function(data) { $(".imagemsg" + _cancelimagecounter).html(data); }); return stopImageUpload();}); \[/code\]Below is the cancelimage.php script where it uses the $GET method to get the file name from the var image_file_name:\[code\]<?php...$image_file_name = $_GET["fileImage"]; echo "File Upload was Canceled"; $imagecancelsql = "DELETE FROM Image WHERE ImageFile = 'ImageFiles/". mysql_real_escape_string($image_file_name)."'"; mysql_query($imagecancelsql); mysql_close();?> \[/code\]