note 61513 added to features.file-upload

From: Date: Mon, 06 Feb 2006 07:42:47 +0000
Subject: note 61513 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-103064@lists.php.net to get a copy of this message
Ïðèâåòñòâóþ! Ïîìîãèòå ïîæàëóéñòî ðàçîáðàòüñÿ? Çàïóñêàþ ñêðèïò ëà localhost ïîä ÎÑ WinXP, Apache2.0.43, PHP4.3.4. Ôàéë èç ôîðìàû íå õî÷åò êîïèðîâàòüñÿ! <html> <head> <title>Gallery administration page</title> <link rel="stylesheet" href="../../public/admin/css/admin.css" type="text/css"> </head> <body> <?php $html = "<center>"; $html .= "<form ENCTYPE=\"multipart/form-data\" id=\"form\" action=\"gallery.php\" method=\"POST\">"; if (!isset($HTTP_POST_VARS['glsc_act'])) $HTTP_POST_VARS['glsc_act']=""; switch ($HTTP_POST_VARS['glsc_act']) { case "add": echo ($HTTP_POST_FILES['image']['tmp_name']." ---> c:\".$HTTP_POST_FILES['image']['name']."<br>"); copy($HTTP_POST_FILE['image']['tmp_name'], "c:".$HTTP_POST_FILES['image']['name']) or die ("Error copy file ".$HTTP_POST_FILES['image']['name']."!"); default: $html .= "<h3>Add new section</h3>"; $html .= "<input type="hidden\" name=\"glsc_act\" value=\"add\">"; $html .= "<table border=\"0\">"; $html .= "<tr>"; $html .= "<td>"; $html .= "<b>Name:</b>"; $html .= "</td>"; $html .= "<td>"; $html .= "<input type=\"Text\" name=\"name\" size=\"80\">"; $html .= "</td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<td>"; $html .= "<b>Image:</b>"; $html .= "</td>"; $html .= "<td>"; $html .= "<input type=\"file\" name=\"image\" size=\"67\">"; $html .= "</td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<td>"; $html .= "<b>Caption:</b>"; $html .= "</td>"; $html .= "<td>"; $html .= "<input type=\"Text\" name=\"caption\" size=\"80\">"; $html .= "</td>"; $html .= "</tr>"; $html .= "<tr>"; $html .= "<td colspan=\"2\" align=\"center\">"; $html .= "<input type=\"Submit\" title=\"Add section to gallery\" value=\"Add Section\">"; } $html .= "</td>"; $html .= "</tr>"; $html .= "</table>"; $html .= "</form>"; $html .= "<a href=\"../../index.php\">[back]</a>"; $html .= "</center>"; echo ($html); ?> </body> </html> Ïûòàþñü êîïèðîâàòü íåáîëüøîé òåêñòîâûé ôàéë. Ñêðèïò ãåíåðèðóåò ñëåäóþùóþ ñòðàíèöó: ------------------------------------------------------------ C:\WINDOWS\TEMP\php174.tmp ---> c:\NoteBook.txt Error copy file NoteBook.txt! ------------------------------------------------------------ Ïðîáûâàë çàìåíèòü copy íà move_upload_file - îøèáêà ïåðåñòàëà ïîÿâëÿòüñÿ, à âîò ôàéë ïî-ïðíæíåìó íå êîïèðóåòñÿ.  òîé-æå ïàïêå, ÷òî è ýòîò ñêðèïò, ëåæèò äðóãîé, â êîòîðîì êîïèðîâàíèå çàãðóæåííîãî ôàéëà ïðîèñõîäèò àáñîëþòíî òàê-æå. Äðóãèå òîëüêî íàçâàíèå ôîðìû, èìÿ êîíòðîëà file è íåêîòîðûõ ãëîáîàëüíûõ ïåðåìåííûõ. Òàì âñå ðàáîòàåò!!! ß äóìàþ äåëà òóò íå â íàñòðîéêàõ ñåðâåðà è íå â êîíôèãóðàöèè php. ---- Server IP: 64.246.30.37 Probable Submitter: 217.116.151.36 ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61513 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61513&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61513&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103064) next »