Rename BLOB form.append
<p>Ok I am stumped, I have been able to successfully upload resized image/blob to server folder. <code>The problem is that the image/blob upload is always called blob.</code>  Is there a way to change name on client side or should i do it on server PHP side?.<br>
And if so can you please give me an example here is the 2 scripts I am using to communicate with</p>

<p>client side Resize</p>

<pre><code>&lt;script&gt;
function handleFiles(){
var dataurl = null;
var filesToUpload = document.getElementById('input').files;
var file = filesToUpload[0];

// Create an image
var img = document.createElement("img");
// Create a file reader
var reader = new FileReader();
// Set the image once loaded into file reader
reader.onload = function(e)
{
    img.src = e.target.result;

    img.onload = function () {
        var canvas = document.createElement("canvas");
        var ctx = canvas.getContext("2d");
        ctx.drawImage(img, 0, 0);

        var MAX_WIDTH = 200;
        var MAX_HEIGHT = 400;
        var width = img.width;
        var height = img.height;

        if (width &gt; height) {
          if (width &gt; MAX_WIDTH) {
            height *= MAX_WIDTH / width;
            width = MAX_WIDTH;
          }
        } else {
          if (height &gt; MAX_HEIGHT) {
            width *= MAX_HEIGHT / height;
            height = MAX_HEIGHT;
          }
        }
        canvas.width = width;
        canvas.height = height;
        var ctx = canvas.getContext("2d");
        ctx.drawImage(img, 0, 0, width, height);
        dataurl = canvas.toDataURL("image/jpeg",.2);
        var blobBin = atob(dataurl.split(',')[1]);
        var array = [];
        for(var i = 0; i &lt; blobBin.length; i++) {
        array.push(blobBin.charCodeAt(i));
        }
       var files = new Blob([new Uint8Array(array)], {type: 'image/jpg', name: ""});
       var filename = getFileName()



        // Post the data
        var fd = new FormData();
        fd.append("image",files);
        $.ajax({
            url: 'http:///www.i-audit-jci.com/upload.php',
            data: fd,
            cache: false,
            contentType: false,
            processData: false,
            type: 'POST',
            success: function(data){
                $('#form_input')[0].reset();
                location.reload();
            }
        });
    } // img.onload
}
// Load files into file reader
reader.readAsDataURL(file);
}
&lt;/script&gt;
</code></pre>

<p>Server PHP</p>

<pre><code>&lt;?php
$upload_image = $_FILES["image"][ "name" ];
$a = ('" alt="" /&gt;');
$folder = "images/";
move_uploaded_file($_FILES["image"]["tmp_name"], "$folder".$_FILES["image"]["name"]);;
$file = 'images/'.$_FILES["image"]["name"];
$uploadimage = $folder.$_FILES["image"]["name"];
$newname = $_FILES["image"]["name"];
$msg = '';
if($_SERVER['REQUEST_METHOD']=='POST'){
$a = ('" alt="" /&gt;');
$image = $_FILES['image']['tmp_name'];
$img = file_get_contents($image);
$con = mysqli_connect('mysql***','***','***','***') or die('Unable To connect');
$sql = ("INSERT into links (hyper_links) VALUES('&lt;img src=\"\https://www.i-audit-jci.com/images/".$_FILES['image']['name']."$a')");

$stmt = mysqli_prepare($con,$sql);

mysqli_stmt_bind_param($stmt, "s",$img);
mysqli_stmt_execute($stmt);

$check = mysqli_stmt_affected_rows($stmt);
if($check==1){
    $msg = 'Successfullly UPloaded';
}else{
    $msg = 'Could not upload';
}
mysqli_close($con);
}
?&gt;
&lt;?php
echo $msg;
?&gt;
</code></pre>