我有一个非常直接的上传页面,允许用户上传文件,当我在通过http://localhost/project/etc访问它的本地机器上运行它时,它运行良好
问题是当我尝试从本地主机外部访问相同的东西时,即使尝试通过我的机器名(http://mycomp1/project/etc)访问它,页面加载/等并且一切似乎都可以工作,但是没有任何东西被转移,我打开了萤火虫,通常它会显示任何正在通过的ajax请求,但我什么也没得到。
有任何想法吗?
我的上传代码:
$('#uploadify').uploadify({
'scriptAccess': 'always',
'uploader': '../../scripts/uploadify.swf', //flash source for handling the uploads and size checking
'cancelImg': '../../content/images/cancel.png', //cool cancel button
'script': '../../' + $('#Controller').val() + '/FileSave/' + $('#OrderID').val(), //sends files to the controller with apropriate data
'folder': 'Uploads', //sets the upload directory, not sure if this matters as the files are sent to the controller
'multi': true, //allows multiple uploads
'auto': false, //uploads dont start automatically
'queueSizeLimit': 5, //5 files can be in the queue at a time
'queueID': 'fileQueue', //div to contain the queue of files
'displayData': 'speed', //shows the transfer speed
'fileExt': '*.pdf', //limits to pdfs
'fileDesc': 'PDF', //shows a description in the browse window of filetypes
'sizeLimit': '5242880', //5mb limit
'scriptData': { 'CategoryID': $('#fileCategory').val() }, //passes the selected value of the category drop down
onComplete: function(event, queueID, fileObj, response, data) {//once a transfer completes fires an ajax function to pull in the files for the order
if (response == "Upload Successful") {//if response is successfull, updates div displaying files with new files
GetFiles($('#Controller').val());
}
}
});
更新:它似乎与 scriptAccess 设置有关,但即使设置为 always,如 uploadify 网站上所说,它仍然没有触发任何后端脚本或我的 onComplete 函数
更新2:在进一步检查时,在非本地主机设置中,我的脚本路径似乎不正确,但现在脚本位于正确的位置,我在 onComplete 函数中得到的响应等于我的登录页面的 html 输出。有任何想法吗?
UPDATE3:看起来我的脚本路径没问题,只是由于某种原因,当不在本地主机上时,我得到了登录页面的响应,而不是像我应该从后端代码那样上传成功或上传失败