上传不上传

时间:2012-03-21 16:10:23

标签: directory uploadify

我正在尝试使用uploadify上传多个文件,但每次“上传”时,文件夹中都没有任何内容。 这是我的代码

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Multiple files upload in PHP with using Uploadify!</title>


<!-- CSS -->

<link rel="stylesheet" href="uploadifyit/uploadify.css" type="text/css" />

<!-- Javascript -->

<script type="text/javascript" src="uploadifyit/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="uploadifyit/swfobject.js"></script>
<script type="text/javascript" src="uploadifyit/jquery.uploadify.v2.1.4.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': 'uploads',
    'auto': false, // use for auto upload
    'multi': true,
    'queueSizeLimit': 4,
    'onQueueFull': function(event, queueSizeLimit) {

        alert("Please don't put anymore files in me! You can upload " + queueSizeLimit + " files at once");

        return false;

    },

    'onComplete': function(event, ID, fileObj, response, data) {

        // you can use here jQuery AJAX method to send info at server-side.

        $.post("insert.php", { name: fileObj.name }, function(info) {
            alert(info); // alert UPLOADED FILE NAME

        });

    }

});


});

</script>
</head>
<body>
<form id="form1" name="form1" action="">
<input type="file" id="file_upload" name="file_upload" /><br />
<a href="javascript:$('#file_upload').uploadifyUpload();">Upload File</a>
</form>
</body>
</html>

我无法找到问题的解决方案。 有人可以帮帮我吗?

提前致谢。

1 个答案:

答案 0 :(得分:0)

似乎您尝试上传的文件夹路径存在问题。首先确保文件夹确实存在。其次改变'folder' : 'uploads',  至 'folder' : 'uploads/',