Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the uploaded files folder for SWFUpload?

I don't see in the documentation how to set the uploaded files folder with SWFUpload.

Can anyone point me to the right direction?

I'm using PHP 5 if it helps.

like image 254
the_drow Avatar asked Feb 28 '23 18:02

the_drow


1 Answers

What you do is call a PHP script, and that script handles the file uploading.

You can turn on debug, this will give you a pretty nice debug view of what is happening, and the output of the PHP file in question.

The flash doesn't handle the uploading because the flash is actually running on the client machine.

Here's an example of the config I use.

    flash_url : "js/swfupload/flash/swfupload.swf",
    upload_url: "ajax/flash_upload.php",
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>", "folder_id" : "<?php echo $_SESSION["folder_id"]; ?>"},
    file_size_limit : "100 MB",
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : 100,
    file_queue_limit : 0,
    custom_settings : {
        progressTarget : "fsUploadProgress",
        cancelButtonId : "btnCancel"
    },
    debug: true,

Then flash_upload.php has something like this (just an example)

$location = "/var/www/html/example.com/files/";
move_uploaded_file($_FILES["Filedata"]["tmp_name"], location .$_FILES["Filedata"]["name"]
like image 132
Ólafur Waage Avatar answered Mar 15 '23 20:03

Ólafur Waage