Помогите! как залить файл через swfupload

Discussion in 'Песочница' started by Evil_Genius, 19 Mar 2014.

  1. Evil_Genius

    Evil_Genius Member

    Joined:
    3 Aug 2009
    Messages:
    519
    Likes Received:
    15
    Reputations:
    -4
    Доброго дня!
    В общем суть вот в чем:
    Есть на нужных сайтах папка с названием swfupload. В них присутствуют все необходимые файлы
    Вот содержимое файла main.js
    PHP:
    var swfu = new SWFUpload(
        {
            
    upload_url "upload.php",
            
    flash_url "swfupload.swf",
            
    button_placeholder_id "uploadButton",
             
            
    file_size_limit "2 MB",
            
    file_types "*.jpg; *.png; *.jpeg; *.gif",
            
    file_types_description "Images",
            
    file_upload_limit "0",
            
    debugfalse,
     
            
    button_image_url"button.png",
            
    button_width 100,
            
    button_height 30,
            
    button_text_left_padding15,
            
    button_text_top_padding2
            
    button_text "<span class=\"uploadBtn\">Обзор...</span>",
            
    button_text_style ".uploadBtn { font-size: 18px; font-family: Arial; background-color: #FF0000; }",
             
            
    file_dialog_complete_handler fileDialogComplete,
            
    upload_success_handler uploadSuccess,
            
    upload_complete_handler uploadComplete,
            
    upload_start_handler uploadStart,
            
    upload_progress_handler uploadProgress
        
    }
    );

    Вот содержимое файла upload.php
    PHP:
    <?php
        
    // Work-around for setting up a session because Flash Player doesn't send the cookies
        
    if (isset($_POST["PHPSESSID"])) {
            
    session_id($_POST["PHPSESSID"]);
        }
        
    session_start();

        if (!isset(
    $_FILES["Filedata"]) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) {
            echo 
    "There was a problem with the upload";
            exit(
    0);
        } else {
            echo 
    "Flash requires that we output something or it won't fire the uploadSuccess event";
        }
    ?>

    Вопрос вот в чем. Как мне составить запрос, чтобы залить любой файл на сайт?
     
  2. sysjuk

    sysjuk Member

    Joined:
    5 Jan 2012
    Messages:
    204
    Likes Received:
    57
    Reputations:
    5
    Так же интересует вопрос по этому продукту, может у кого какие либо мысли есть.
    Спасибо заранее.