[Typo3-dev] problem with fileupload in custom backend module
Daniel Thomas
dt at dpool.net
Fri Aug 22 13:51:10 CEST 2003
Hello together,
I am having a little problem with a fileupload functionality in a
Backend-Module I am writing just now.
It worked very well last weekend. Yesterday I revisited it and can't
get the fileupload any more.
#######
<snip>
switch((string)$this->MOD_SETTINGS["function"]) {
case 1:
$content = '';
$content.= $this->getUploadForm();
debug($GLOBALS["HTTP_POST_FILES"]);
# if there is an uploadfile waiting in the pipeline we will deal
with its data from here on
if($GLOBALS["HTTP_POST_FILES"]["uploadfile"]) {
# move the file into the uploads folder of the extension
# if everything runs fine we will call the content parsefunc on
the uploaded file
$filename =
$GLOBALS["HTTP_SERVER_VARS"]["DOCUMENT_ROOT"]."/uploads/
tx_dpdealersearch/".$HTTP_POST_FILES["uploadfile"]["name"];
if(move_uploaded_file($GLOBALS["HTTP_POST_FILES"]["uploadfile"]["tmp_nam
e"],$filename)) {
# call import function
$content.= $this->importData($filename);
# display success of upload if apropriate
if($this->importError) {
$content.= $LANG->getLL("importError");
}
else {
$content.= $LANG->getLL("importSuccess");
}
}
# if the upload is not successful display error message here
else {
$content.= $LANG->getLL("uploadError");
}
}
$this->content.=$this->doc->section($LANG-
>getLL("importHeader").": '".$this->config["title"]."'",$content,1,1);
break;
}
<snap>
#######
This part of the code is located in function main of the index.php of
the module. A form calls this script with action="index.php" and the
file-field of the form is called "uploadfile", of course.
Now, no matter what I do the $GLOBALS ["HTTP_POST_FILES"] is empty as
would be $HTTP_POST_FILES if I declare it global for the function main.
That was not so a couple of days ago.
Actually, I do not even see how I can post an intelligent question for
my problem as the code that you see there did definitely work three
days ago. No changes to the server since then. Does not work on other
servers as well. using 3.5.0.
Anyone with a magic thought?
Thanks a lot
Daniel
--/
Daniel Thomas dpool
Hinderink und Thomas Partnerschaft IT-Berater und Projektmanager
Isartorplatz 5 | D-80331 München
t 08912018917 | m 01793918781 | eFax 02561959115820
http://www.dpool.net | http://www.typergy.com
/--
More information about the TYPO3-dev
mailing list