如何为SWFUpload设置上传的文件文件夹?

时间:2022-04-11 07:09:06

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

我没有在文档中看到如何使用SWFUpload设置上传的文件文件夹。

Can anyone point me to the right direction?

谁能指出我正确的方向?

I'm using PHP 5 if it helps.

如果它有用,我正在使用PHP 5。

2 个解决方案

#1


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

你所做的是调用PHP脚本,该脚本处理文件上传。

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.

你可以打开调试,这将为你提供一个非常好的调试视图,看看发生了什么,以及有问题的PHP文件的输出。

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)

然后flash_upload.php有这样的东西(只是一个例子)

$location = "/var/blablabla/files/";
move_uploaded_file($_FILES["Filedata"]["tmp_name"], $location . $_FILES["Filedata"]["name"]);

#2


SWFUpload is given a URL to send the upload to, e.g. http://yourdomain.com/upload.php - it is this script which determines what will happen to the upload.

SWFUpload被赋予用于发送上载的URL,例如, http://yourdomain.com/upload.php - 正是这个脚本决定了上传会发生什么。

See the PHP Manual section on Handling File Uploads for more information.

有关更多信息,请参阅“处理文件上载”的“PHP手册”部分。

#1


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

你所做的是调用PHP脚本,该脚本处理文件上传。

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.

你可以打开调试,这将为你提供一个非常好的调试视图,看看发生了什么,以及有问题的PHP文件的输出。

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)

然后flash_upload.php有这样的东西(只是一个例子)

$location = "/var/blablabla/files/";
move_uploaded_file($_FILES["Filedata"]["tmp_name"], $location . $_FILES["Filedata"]["name"]);

#2


SWFUpload is given a URL to send the upload to, e.g. http://yourdomain.com/upload.php - it is this script which determines what will happen to the upload.

SWFUpload被赋予用于发送上载的URL,例如, http://yourdomain.com/upload.php - 正是这个脚本决定了上传会发生什么。

See the PHP Manual section on Handling File Uploads for more information.

有关更多信息,请参阅“处理文件上载”的“PHP手册”部分。