WML024.php
1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
//*****************************************************************************
//*
//* プログラム名:WEBメール
//* プログラムID:WML024.php
//* 機能 :添付ファイル取得(受信詳細)
//* 作成者 :
//*
//*****************************************************************************
include("./include/jcode.phps");
include("include/session_start.inc");
include("include/SessionChk.inc");
//**** DB接続 ****//
$strDBinc="./include/dbcon.inc";
include($strDBinc);
function subRetURI($prmStr){
$prmStr = str_replace("EgruProPlus", "+", $prmStr);
$prmStr = str_replace("EgruProAnp", "&", $prmStr);
$prmStr = str_replace("EgruProPer", "%", $prmStr);
$prmStr = str_replace("EgruProNum", "#", $prmStr);
$prmStr = str_replace("EgruProSing", "'", $prmStr);
$prmStr = str_replace("EgruProDoub", '"', $prmStr);
$prmStr = str_replace("EgruProDoll", "$", $prmStr);
$prmStr = str_replace("EgruProhyph", "-", $prmStr);
return $prmStr;
}
list($strKey[0],$strKey[1],$strKey[2])=split("-",$TempName);
$strSQLseq="Select * from mail_temp_tbl Where syain_cd='$strKey[0]' and temp_index=$strKey[1] and mail_id='".str_replace("'", "''", subRetURI($strKey[2]))."'";
//メール情報取得
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecseq) > 0){
$objmail = pg_fetch_object($objRecseq, 0);
$filename=$objmail->temp_name;
}
$filename = JcodeConvert($filename, 1, 2);
Header("Content-Disposition: attachment; filename=\"$filename\"");
Header("Content-Type: Application/Octet-Stream");
session_start();
$fp = fopen(str_replace("'", "''", subRetURI($FilePath)),"r");
$file = fread($fp,10000000);
echo $file;
?>