jQuery-file-upload with PHP class
<p>I am using jQuery file upload from blueImp to upload files to a web directory. For the most part it works, tho it consistently drops a file. I use the following for an ajax request. This loops through each of the files uploaded and images.php writes to DB.</p>

<pre><code>//On successfull upload of pages
    $('#albumPages.fileupload').bind('fileuploadalways',function(e,data) {
        //Loop through each page and return object and write to DB
        $.each(data.files, function (index, file) {
            var filename = data.result[0].name;
            $.ajax({ 
                type: "POST",
                url: "../queries/images.php",
                data: {file: filename}
            });
        });
        //CSS to change GUI

        $('#albumPages.fileupload').bind('fileuploadstop' , function(e,data) {
            $('.modal_uploader_pages').css("display","none");
            $('.modal_uploader_back').css("display","block");
            $('.breadcrumbs').css("background-position","left 128px");
        });
    });
</code></pre>

<p><strong>The DB write</strong></p>

<pre><code>INSERT INTO galleryimage 
            (
                galleryId
                ,image
                ,OrgImageName
                ,clientRef
                -- ,sort
                ,layout
            ) VALUES (
                '{$galleryID}'
                ,'{$imageID}'
                ,'{$originalName}'
                ,'{$clientRef}'
                -- ,'{$order}'
                ,'{$galleryLayout}'
            )"
</code></pre>

<p>The error that I receive using the 'Network' tab from Chrome  Developer tool is a 500 Internal Server Error. Any insight or direction on trouble shooting this issue. I have SSH'd into the server to check the php error log and nothing there in regards to this event. </p>
