File upload 将swfupload与Playframework和Mac一起使用

File upload 将swfupload与Playframework和Mac一起使用,file-upload,playframework,swfupload,File Upload,Playframework,Swfupload,我正在尝试使用这个剧本来实现SWFUpload!框架和Mac。 当使用Mac电脑时,我得到一个302错误(上传错误:302)。我认为,这似乎来自于通过获取该剧的上传页面而发生的重定向!框架(因为它是从routes文件翻译过来的?) 它在Windows上的IE上运行良好 我已经搜索了很多,读了很多,但是没有发现是否有一个特定的解决方案。对于如何实现这一点,或者对于另一个易于实现的文件上传程序(对于大字段,有进展的)有什么建议吗 编辑: 我在Macbook上尝试过Safari和Firefox,但都返

我正在尝试使用这个剧本来实现SWFUpload!框架和Mac。 当使用Mac电脑时,我得到一个302错误(上传错误:302)。我认为,这似乎来自于通过获取该剧的上传页面而发生的重定向!框架(因为它是从routes文件翻译过来的?)

它在Windows上的IE上运行良好

我已经搜索了很多,读了很多,但是没有发现是否有一个特定的解决方案。对于如何实现这一点,或者对于另一个易于实现的文件上传程序(对于大字段,有进展的)有什么建议吗

编辑:

我在Macbook上尝试过Safari和Firefox,但都返回302上传错误状态。我用IE在Windows上再试了一次,效果很好

html(样式表)代码:

编辑2:
我还尝试了Uploadify,它返回相同的错误。有谁知道这出戏的变通方法吗!框架或一个上传器,确实与发挥工作

如果您在
/admin/articles/{id}/upload
中,并且在没有任何/path/to/something的情况下调用
doUpload
,则您的“目录”错误。可能是您在本地测试Windows,而在远程测试MacOS


在任何情况下,问题很可能与操作系统无关,而是与其他方面有关。

有一个html 5上传程序,可以以5美元的价格下载,到目前为止,它非常适合我。

您是否在Mac上尝试过,但使用了不同的浏览器?你处理文件上传的代码是什么?我添加了样式表的代码,还检查了Mac上的firefox,但没有乐趣(我有最新的Flash PLayer(11.4)。我尝试了一下。我从Parallels“远程”运行Windows,并在我的Mac上本地(本地主机)测试。但我还有另一台Mac要检查。我还会查看路径。如果我确保它完全相同,可能就不需要302。我尝试了这两种建议,在网络上的另一台Mac和网络上的另一台windows计算机上进行了测试,但仍然存在相同的问题。Play!框架必须使用302重定向Mac doe上的哪个Flash播放器It’不支持。
#{extends 'main.html' /}
#{set title: 'Upload Media File' /}

<script type="text/javascript" src="/public/swfupload/swfupload.js"></script>
<script type="text/javascript" src="/public/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="/public/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="/public/swfupload/handlers.js"></script>

<script type="text/javascript">
    var swfu;

    window.onload = function() {
    var settings = {
    flash_url : "/public/swfupload/swfupload.swf",
    flash9_url : "/public/swfupload/swfupload_fp9.swf",
    upload_url: "doUpload",
    file_post_name: "data",
    post_params: {"article.id" : "${article?.id}"},
    file_size_limit : "1000 MB",
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : 1,
    file_queue_limit : 0,
    custom_settings : {
    progressTarget : "fsUploadProgress",
    cancelButtonId : "btnCancel"
    },
    debug: false,

    // Button settings
    button_image_url: "/public/swfupload/TestImageNoText_65x29.png",
    button_width: "65",
    button_height: "29",
    button_placeholder_id: "spanButtonPlaceHolder",
    button_text: '<span>Start</span>',
    button_text_style: ".theFont { font-size: 16; }",
    button_text_left_padding: 12,
    button_text_top_padding: 3,

    // The event handler functions are defined in handlers.js
    swfupload_preload_handler : preLoad,
    swfupload_load_failed_handler : loadFailed,
    file_queued_handler : fileQueued,
    file_queue_error_handler : fileQueueError,
    file_dialog_complete_handler : fileDialogComplete,
    upload_start_handler : uploadStart,
    upload_progress_handler : uploadProgress,
    upload_error_handler : uploadError,
    upload_success_handler : uploadSuccess,
    upload_complete_handler : uploadComplete,
    queue_complete_handler : queueComplete  // Queue plugin event
    };

    swfu = new SWFUpload(settings);
    };

</script>

<h2 class="title">#{get 'title' /}</h2>
<div style="clear: both;">&nbsp;</div>
#{form @index(), id:'uploadForm', enctype:'multipart/form-data'}
<div class="entity">
    <p>This page demonstrates a simple usage of SWFUpload.  It uses the Queue Plugin to simplify uploading or cancelling all queued files.</p>

    <div class="fieldset flash" id="fsUploadProgress">
        <span class="legend">Upload Queue</span>
    </div>
    <div id="divStatus">0 Files Uploaded</div>
    <div>
        <span id="spanButtonPlaceHolder"></span>
        <input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
    </div>
</div>
#{/form}
GET     /admin/articles/{id}/upload             Articles.upload
POST    /admin/articles/doUpload                Articles.doUpload