如何为SWFUpload设置上传的文件文件夹? [英] How do I set the uploaded files folder for SWFUpload?

查看:146
本文介绍了如何为SWFUpload设置上传的文件文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都可以指向正确的方向吗?



我使用的是PHP 5,如果有帮助的话。

解决方案

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



你可以打开调试,这将给你一个相当不错的调试视图是什么发生的问题以及PHP文件的输出。



Flash不处理上传,因为flash实际上是在客户端机器上运行的。



下面是我使用的配置示例。

  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 :所有文件,
file_upload_limit:100,
file_queue_limit:0,
custom_settings:{
progressT arget:fsUploadProgress,
cancelButtonId:btnCancel
},
debug:true,

然后flash_upload.php就是这个样子(只是一个例子)

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ = VAR / blablabla /文件/;
move_uploaded_file($ _ FILES [Filedata] [tmp_name],$ location。$ _FILES [Filedata] [name]);


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.

解决方案

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/blablabla/files/";
move_uploaded_file($_FILES["Filedata"]["tmp_name"], $location . $_FILES["Filedata"]["name"]);

这篇关于如何为SWFUpload设置上传的文件文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆