MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
EasyDownload.class
Ir para a documentação deste ficheiro.
1
<?php
8
class
EasyDownload
9
{
10
var
$ContentType
;
11
var
$ContentLength
;
12
var
$ContentDisposition
;
13
var
$ContentTransferEncoding
;
14
var
$Path
;
15
var
$FileName
;
16
var
$FileNameDown
;
17
22
function
EasyDownload
()
23
{
24
$this->ContentType =
"application/save"
;
25
$this->ContentLength =
""
;
26
$this->ContentDisposition =
""
;
27
$this->ContentTransferEncoding =
""
;
28
$this->Path =
""
;
29
$this->FileName =
""
;
30
$this->FileNameDown =
""
;
31
}
22
function
EasyDownload
() {
…
}
32
38
function
setContentType
($strValue)
39
{
40
$this->ContentType = $strValue;
41
}
38
function
setContentType
($strValue) {
…
}
42
48
function
_setContentLength
()
49
{
50
$this->ContentLength = filesize($this->Path .
"/"
. $this->FileName);
51
}
48
function
_setContentLength
() {
…
}
52
57
function
setContentDisposition
($strValue)
58
{
59
$this->ContentDisposition = $strValue;
60
}
57
function
setContentDisposition
($strValue) {
…
}
61
66
function
setContentTransferEncoding
($strValue)
67
{
68
$this->ContentTransferEncoding = $strValue;
69
}
66
function
setContentTransferEncoding
($strValue) {
…
}
70
75
function
setPath
($strValue)
76
{
80
if
(strpos($strValue,
".."
) ===
false
)
81
{
82
$this->Path = $strValue;
83
}
84
else
85
{
86
die (
"Trying to access an URL with '..'"
);
87
}
88
}
75
function
setPath
($strValue) {
…
}
89
94
function
setFileName
($strValue)
95
{
99
if
(strpos($strValue,
".."
) ===
false
)
100
{
101
$this->FileName = $strValue;
102
}
103
else
104
{
105
die (
"Trying to access an URL with '..'"
);
106
}
107
}
94
function
setFileName
($strValue) {
…
}
108
114
function
setFileNameDown
($strValue)
115
{
116
$this->FileNameDown = $strValue;
117
}
114
function
setFileNameDown
($strValue) {
…
}
118
123
function
send
()
124
{
125
$this->
_setContentLength
();
126
header (
"Content-Type: "
. $this->ContentType);
127
header (
"Content-Length: "
. $this->ContentLength);
128
129
if
($this->FileNameDown ==
""
)
130
header (
"Content-Disposition: attachment; filename="
. $this->FileName);
131
else
132
header (
"Content-Disposition: attachment; filename="
. $this->FileNameDown);
133
134
header (
"Content-Transfer-Encoding: binary"
);
135
$fp = fopen($this->Path .
"/"
. $this->FileName,
"r"
);
136
fpassthru ($fp);
137
fclose ($fp);
138
exit();
139
}
123
function
send
() {
…
}
140
}
8
class
EasyDownload
{
…
};
141
?>
EasyDownload
Definição
EasyDownload.class:9
EasyDownload\_setContentLength
_setContentLength()
Definição
EasyDownload.class:48
EasyDownload\EasyDownload
EasyDownload()
Definição
EasyDownload.class:22
EasyDownload\send
send()
Definição
EasyDownload.class:123
EasyDownload\setPath
setPath($strValue)
Definição
EasyDownload.class:75
EasyDownload\setFileNameDown
setFileNameDown($strValue)
Definição
EasyDownload.class:114
EasyDownload\$FileName
$FileName
Definição
EasyDownload.class:15
EasyDownload\setFileName
setFileName($strValue)
Definição
EasyDownload.class:94
EasyDownload\$ContentType
$ContentType
Definição
EasyDownload.class:10
EasyDownload\$ContentLength
$ContentLength
Definição
EasyDownload.class:11
EasyDownload\$ContentTransferEncoding
$ContentTransferEncoding
Definição
EasyDownload.class:13
EasyDownload\$FileNameDown
$FileNameDown
Definição
EasyDownload.class:16
EasyDownload\setContentDisposition
setContentDisposition($strValue)
Definição
EasyDownload.class:57
EasyDownload\setContentTransferEncoding
setContentTransferEncoding($strValue)
Definição
EasyDownload.class:66
EasyDownload\$ContentDisposition
$ContentDisposition
Definição
EasyDownload.class:12
EasyDownload\setContentType
setContentType($strValue)
Definição
EasyDownload.class:38
EasyDownload\$Path
$Path
Definição
EasyDownload.class:14
classes
contrib
EasyDownload.class
Gerado por
1.10.0