2013-08-27 2 views
0

서버에 파일을 업로드 할 때 문제가 있습니다. uploadify 플러그인을 사용하여 내 서버에 파일을 업로드 한 다음 파일 이름을 데이터베이스에 저장합니다.내 서버에 Uploadify를 사용하여 파일을 업로드 할 수 없습니다.

문제는 uplodify가 파일이 아무런 오류없이 업로드되었지만 업로드되는 것이 아니라는 것입니다.

나는 다음과 같은 윈도우 2008 R2 서버

에 PHP를들이받은하고하면 실제 업로드를 처리 내 PHP 코드입니다.

<?php 

require("../requires/LDAP_connection.php"); 
require("../requires/APP_configuration.php"); 
require("../requires/PHP_generic_functions.php"); 

//Include connection class 
require('../classes/connection.php'); 
require('../requires/user_authentication.php'); //this file must be placed under the connection class NOT before 

define('ROOT_SYS', dirname(__FILE__).'/'); 

// Define a destination 
$targetFolder = ''; 
$verifyToken = '100'; 
$actualToken = ''; 
$fileTypes = array('jpg','jpeg','gif','png'); 

if(isset($_POST['upload_path'])){ 
    $targetFolder = $_POST['upload_path']; 
} 

if(isset($_POST['timestamp'])){ 
    $verifyToken = md5($_POST['timestamp']); 
} 

if(isset($_POST['token'])){ 
$actualToken = $_POST['token']; 
} 

if(isset($_POST['allowed_extentions'])){ 

    $types = explode(',', $_POST['allowed_extentions']); 

    if(count($types) > 0){ 
     $fileTypes = $types; 
    } 
} 


if (!empty($_FILES) && $actualToken == $verifyToken) { 
    $tempFile = $_FILES['Filedata']['tmp_name']; 
    $targetPath = ROOT_SYS . $targetFolder; //$_SERVER['DOCUMENT_ROOT'] 
    $new_filename = USER_ID . '_' . time() . '_' . str_replace(" ", "_", $_FILES['Filedata']['name']); 
    $targetFile = $targetPath . $new_filename; 

    // Validate the file type 
    //$fileTypes = array('jpg','jpeg','gif','png'); // File extensions 
    $fileParts = pathinfo($new_filename); //str_replace(" ", "_", $_FILES['Filedata']['name']) 

    if (in_array($fileParts['extension'],$fileTypes)) { 
     move_uploaded_file($tempFile,$targetFile); 
     echo trim($new_filename); 
    } else { 
     echo 'INVALID'; 
    } 
} 
?> 

다음 내 자바 스크립트 내가 잘못 뭐하는 거지

<?php $timestamp = time();?> 

    <script type="text/javascript"> 
    $(function() { 
     $('#file_upload').uploadify({ 
      'formData'  : { 
       'timestamp' : '<?php echo $timestamp;?>', 
       'token'  : '<?php echo md5($timestamp);?>', 
       'upload_path': 'add-ons/ticketing_system/uploads/', 
       'allowed_extentions': 'jpg,jpeg,gif,PNG,JPG,png,zip,rar,doc,docx,cvs,xls,xlsx,txt' 
      }, 
      'auto' : true, 
      'swf'  : '../../includes/uploadify.swf', 
      'uploader' : '../../includes/uploadify.php', 
      'fileSizeLimit' : '10MB', 
      'fileTypeExts' : '*.gif; *.jpg; *.JPG; *.png; *.PNG *.zip; *.rar; *.doc; *.docx; *.cvs; *.xls; *.xlsx; *.txt;', 
      'onUploadSuccess' : function(file, data, response) { 
       if(data != 'INVALID'){ 
        $('#attached_files').append('<input type="hidden" name="attachments[]" value="'+ $.trim(data) +'" />'); 
       } else { 

        alert('Invalid File Type'); 
       } 
      } 

     }); 
    }); 
</script> 

입니까? 왜 아무것도 업로드하지 않고 나에게 오류를주지 않는 이유는 무엇입니까? http://www.uploadify.com/documentation/uploadifive/debug-2/

나는 보통 찾는 일들 권한 오류 ... 어쩌면 당신의 인증 방법은 다음과 같습니다

감사

답변

0

Uploadify이 같은 문제와 함께 당신을 도울 수있는 디버그 모드가 있습니다.

+0

이 힌트에 감사드립니다. 디버깅 모드를 켜기 만하면되지만 여기서 내가 무엇을 찾고 있어야하는지 잘 모르겠습니다. 모든 것이 정상적으로 보입니다. 내가 찾는 게 뭐니 뭐니? – Jaylen

관련 문제