Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
fckupload.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Upload image from FCKeditor
9
*
10
* @author Anakeen 2007
11
* @version $Id: fckupload.php,v 1.3 2008/03/10 10:45:52 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
19
include_once (
"FDL/modcard.php"
);
20
/**
21
* Upload image from FCKeditor
22
* @param Action &$action current action
23
* @global $_FILES['NewFile'] Http var : file to store
24
*/
25
function
fckupload
(&
$action
)
26
{
27
28
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
29
global $_FILES;
30
31
$doc
=
createDoc
(
$dbaccess
,
"IMAGE"
);
32
33
$k =
'NewFile'
;
34
$filename
=
insert_file
(
$doc
, $k,
true
);
35
36
if
(
$filename
!=
""
) {
37
$doc
->SetValue(
"img_file"
,
$filename
);
38
$err
=
$doc
->add();
39
if
(
$err
==
""
) {
40
$doc
->postmodify();
41
$err
=
$doc
->modify();
42
43
$action
->lay->set(
"docid"
,
$doc
->id);
44
$action
->lay->set(
"title"
,
$doc
->title);
45
if
(preg_match(
PREGEXPFILE
,
$filename
, $reg)) {
46
$vid = $reg[2];
47
$action
->lay->set(
"vid"
, $vid);
48
}
49
}
50
}
51
}
52
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase