使用ajax上载图像文件时发生HTTP错误

时间:2013-03-18 13:45:12

标签: ajax file-upload

我有以下Jquery代码来上传图片库的图片文件。它在本地工作良好,但在实时网站,上传图像文件HTTP错误发生

<script type="text/javascript" src="uploadifyit/swfobject.js"></script>
<script type="text/javascript" src="uploadifyit/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

    //alert('I am ready to use uploadify!');
    $("#file_upload").uploadify({
        'uploader': 'uploadifyit/uploadify.swf',
        'script': 'uploadifyit/uploadify.php',
        'cancelImg': 'uploadifyit/cancel.png',
        'folder': 'photogallery',
        'auto': false, // use for auto upload
        'multi': true,
        'queueSizeLimit': 100,
        'onQueueFull': function(event, queueSizeLimit) {
            alert("Please don't put anymore files in me! You can upload Only 50 files");
            return false;
        },
        'onComplete': function(event, ID, fileObj, response, data) {
            // you can use here jQuery AJAX method to send info at server-side.
            $.post("insertphoto.php", { name: fileObj.name }, function(info) {
                //alert(info); // alert UPLOADED FILE NAME
            }); alert("Photos Uploaded Successfully.....");     

        }

    });



});

</script>

0 个答案:

没有答案