WML033.php
1.32 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
<?php
//*****************************************************************************
//*
//* プログラム名:添付ファイル取得(送信詳細)
//* プログラムID:WML033.php
//* 機能 :添付ファイル取得(送信詳細)
//* 作成者 :Y.Hamaya(MTC)
//*
//* Copyright (C) 2004 Media Tech Inc. All rights reserved.
//*****************************************************************************
include("./include/jcode.phps");
include("include/session_start.inc");
include("include/SessionChk.inc");
//**** DB接続 ****//
$strDBinc="./include/dbcon.inc";
include($strDBinc);
list($strKey[0],$strKey[1],$strKey[2])=split("-",$TempName);
$strSQLseq="Select * from mail_send_tbl Where syain_cd='$strKey[0]' and send_date='$strKey[1]'";
//メール情報取得
$objRecseq = pg_exec($strSQLseq);
if($objRecseq==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRecseq) > 0){
$objmail = pg_fetch_object($objRecseq, 0);
if($strKey[2]==1){$filename=$objmail->filename_jp1;}
if($strKey[2]==2){$filename=$objmail->filename_jp2;}
if($strKey[2]==3){$filename=$objmail->filename_jp3;}
}
$filename = JcodeConvert($filename, 1, 2);
Header("Content-Disposition: attachment; filename=\"$filename\"");
Header("Content-Type: Application/Octet-Stream");
session_start();
$fp = fopen($FilePath,"r");
$file = fread($fp,10000000);
echo $file;
?>