ユーザーがファイルをアップロードできるようにする非常に単純なアップロードされたページがあります。http://localhost/project/etcからアクセスするローカルマシンで実行すると、美しく機能します
問題は、マシン名( http://mycomp1/project/etc )を介してアクセスしようとしても、ローカルホストの外部から同じものにアクセスしようとすると、ページがロード/etcされ、すべてが機能しているように見えますが、何も転送されていません。私はfirebugを開いており、通常は通過中の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 設定を使用しているように見えますが、常に設定されている場合でも、uploadify Web サイトで述べられているように、バックエンド スクリプトや onComplete 関数はまだ起動されていません。
更新 2: さらに調べてみると、ローカルホスト以外の設定ではスクリプト パスが正しくないように見えますが、スクリプトが正しい場所にあるため、onComplete 関数で得られる応答は、ログイン ページの html 出力と同じです。何か案は?
更新 3: スクリプト パスは問題ないように見えますが、何らかの理由で localhost 上にないときに、バックエンド コードからのアップロードの成功またはアップロードの失敗ではなく、ログイン ページの応答が返されます。