Article View: pl.comp.lang.php
Article #220094newbie: uploadowanie pliku
From: jivanmuktaWYTNIJTO
Date: Sat, 08 Aug 2009 16:50
Date: Sat, 08 Aug 2009 16:50
28 lines
1781 bytes
1781 bytes
Dzień dobry,
Zrobiłem formularz z uploadowaniem pliku:
<form name="statement" action="import_statement.php" method="POST"
onsubmit="validate();">
...
<input id="filepath" name="filepath" onblur="PassFile();" type="file"
style="width: 45ex">
<input value="" id="statement_file" name="statement_file" type="hidden">
...
W pliku import_statement.php mam:
if (array_key_exists('statement_file', $_POST) &&
is_uploaded_file($_FILES['filepath']['tmp_name'])) {
$file = 'statements/' . $_FILES['filepath']['name'];
if (!move_uploaded_file($_FILES['filepath']['tmp_name'], $file)) {
$_SESSION['error'] = ERRMSG_CANNOT_UPLOAD_STATEMENT;
}
}
Problem w tym, że funkcja is_uploaded_file() zwraca mi false, a na
$_FILES['filepath']['error'] mam null.
Proszę o pomoc. Byłbym wdzięczny za wskazówki.
--
Wysłano z serwisu OnetNiusy: http://niusy.onet.pl
Technical Details
Message-ID:
<51d9.0000003e.4a7dacc9@newsgate.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsgate1.onet.pl!niusy.onet.plShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsgate1.onet.pl!niusy.onet.pl From: jivanmuktaWYTNIJTO@poczta.onet.pl Newsgroups: pl.comp.lang.php Subject: newbie: uploadowanie pliku Date: Sat, 08 Aug 2009 18:50:17 +0200 Organization: Onet.pl Lines: 28 Sender: korbka@newsgate1.test.onet.pl Message-ID: <51d9.0000003e.4a7dacc9@newsgate.onet.pl> NNTP-Posting-Host: newsgate1.onet.pl Mime-Version: 1.0 X-Trace: newsgate1.test.onet.pl 1249750217 30451 213.180.130.17 (8 Aug 2009 16:50:17 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Sat, 8 Aug 2009 16:50:17 +0000 (UTC) X-Mailer: http://niusy.onet.pl X-Forwarded-For: 83.28.88.178, 192.168.243.41 X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit