さて、でファイルのアップロードをテストしているときに、InternetExplorerからこの奇妙な予期しない応答が表示さsmarty
れphp
ます。
view
ここでは、activecollabを使用したことがない人のために、ファイルアップロード()のスマートなコードを主要な問題に簡略化してRouter::assemble
、MVCから読み取ったパラメーターを使用してURLを作成しています。
(出典:iforce.co.nz)
<div id="xero_invoice_manager_api">
{form action=Router::assemble('xero_invoice_manager_api') method=post id="xero_invoice_manager" enctype="multipart/form-data"}
<div class="content_stack_wrapper">
<input type="file" name="file_1" /><br/>
<input type="file" name="file_2" /><br/>
{wrap_buttons}
{submit success_event="api_updated" }Authenticate{/submit}
{/wrap_buttons}
{/form}
</div></div>
そして、これが私のjqueryですview
。
App.Wireframe.Events.bind('api_event_finished.content', function(event, settings) {
App.Wireframe.Flash.success(App.lang('Xero Invoice Manager has saved/uploaded your Xero API data.'));
});
これが私の簡略化されたコントローラーです(問題はPHPではなくsmartyにあることがわかりました)。
//api view
function api(){
if ( $this->request->isSubmitted()) {
$this->response->respondWithData(true);
}
}
これがアップロードが行われている私のコントローラーです。
//api view
function api(){
$this->assignSmarty();
if ($this->request->isSubmitted()) {
$this->XeroAuthUpdate(); //update everything
if(isset($_FILES)){
$file_manager = new XeroFileManager();
$file_manager->dumpFiles($_FILES);
//upload the files
foreach($_FILES as $file){
$file_manager->handle_certificate_file($file);
} //foreach add the headers
if(function_exists('headers_list')){
xeroDebugMode("[Controller] the headers to be sent are... ", headers_list());
} //function check
} //end if
$this->response->respondWithData(array(
// constraints
'key_result' => (bool)$this->checkValue(XeroAuths::getSetting('xero_consumer')),
'secret_result' => (bool)$this->checkValue(XeroAuths::getSetting('xero_secret')),
// files secruity certificates
'publickey' => (bool)file_exists(XERO_PUBLIC_KEY_PATH),
'privatekey' => (bool)file_exists(XERO_PRIVATE_KEY_PATH),
'xero_auth' => (bool)validateXeroAuth(),
//login constraints
'install' => !$this->checkInstallRequirements(),
));
} //close the request
}
これは、空ではなく、file_1
を使用したFirefoxからの応答です。file_2
(出典:iforce.co.nz)
これは、Internet Explorer 9からの応答ですfile_1
(file_2
これまでのところ良好です)。
(出典:iforce.co.nz)
これは、Internet Explorer 9からの問題file_1
のある応答です。(つまり、publickey.cer)とfile_2
(つまり、privatekey.pem)は空ではありません(index.phpをダウンロードしますか?)。
(出典:iforce.co.nz)
activecollabからの私の応答
こんにちはミシェル、
返事が遅れて申し訳ありません。
残念ながら、問題がどこにあるのか理解できません。すべてが正常に記述されているように見えますが、コード自体を処理しなければ、私たちにできることはほとんどありません。IEでのJSON応答の処理は、activeCollab全体で正常に機能します(IE6ではありません)。aC3のほとんどすべてがJSONに基づいているため、問題が特定され、コードに問題がある可能性があります。
よろしく、オリバーマクシモビッチactiveCollabの開発とサポート
一般および販売前の質問:1-888-422-6260(フリーダイヤル)テクニカルサポート:support@activecollab.com
アソシエイトが提案しました。
ただし、次のことを試してみることをお勧めします。1)IEを開く->開発者ツールを開く(F12キーを押す)->メニューの[キャッシュ]をクリック-> [ブラウザキャッシュのクリア]をクリック...終了したら、[キャッシュ]をクリックし、[キャッシュ]をクリックします。 「常にサーバーから更新する」。
IEがajaxリクエストをキャッシュし、非常に奇妙な動作を引き起こしていたことが何度もあったため、これによりIEは何もキャッシュしなくなります。
これで問題が解決するかどうかを教えてください。問題が解決する場合は、ajax応答にphpを追加して、すべてのブラウザーに応答をキャッシュしないように強制できます。それでも問題が解決しない場合は、IEでJSデバッグを実行して、送信内容を確認し、FFFirebugの結果と比較する必要があります。
headers_sent()
空白になります
ただし、Internet Explorerの場合はheaders_list
(直前に呼び出されます)。respondWithData
2012-08-08 06:50:16 the headers sent from this request is... Array
(
[0] => X-Powered-By: PHP/5.3.8
[1] => Set-Cookie: ac_activeCollab_sid_yhRk0xSZku=1%2Fhkykz0Rw0796e4lDykXekNXvhMMxC8pV4akJPMvA%2F2012-08-08+06%3A50%3A15; expires=Wed, 22-Aug-2012 06:50:15 GMT; path=/
[2] => Content-Type: application/json
[3] => Expires: Mon, 26 Jul 1997 05:00:00 GMT
[4] => Cache-Control: no-cache, no-store, must-revalidate
[5] => Pragma: no-cache
)
Raw
InternetExplorerのFiddlerのタブからの応答ヘッダー
HTTP/1.1 200 OK
Date: Sat, 11 Aug 2012 08:08:46 GMT
Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: ac_activeCollab_sid_yhRk0xSZku=11%2Fz8rWxiRchAh8EWinYO2d7a1mmvn2DMKUdse1vfKh%2F2012-08-11+0 8%3A08%3A46; expires=Sat, 25-Aug-2012 08:08:46 GMT; path=/
Content-Length: 107
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
{"key_result":true,"secret_result":true,"publickey":true,"privatekey":true,"xero_auth":true,"install":true}
Raw
Firefoxのタブからの応答ヘッダー。
HTTP/1.1 200 OK
Date: Sat, 11 Aug 2012 08:13:45 GMT
Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: ac_activeCollab_sid_yhRk0xSZku=12%2FO40CbXC9Vfa7OVnderlK2MFnvnpkyeckvO0Ab5NQ%2F2012-08-11+08%3A13%3A45; expires=Sat, 25-Aug-2012 08:13:45 GMT; path=/
Content-Length: 107
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
{"key_result":true,"secret_result":true,"publickey":true,"privatekey":true,"xero_auth":true,"install":true}
IEで何が間違っているのかについてのアイデアはありますか?また、Internet Explorerがユーザーにダウンロードを通知する理由index.php
(フィールドが値でアクティブになっている場合)。サーバー側では実際のアップロードは行われていないことに注意してください(最初のテストでは、index.phpのダウンロード要求は関係ありませんmove_uploaded_file
)。