php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34922 move_uploaded_file doesn't work correctly
Submitted: 2005-10-19 23:50 UTC Modified: 2005-10-27 01:00 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: cezarsignori at gmail dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 4.4.1RC1 OS: Windows XP Professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cezarsignori at gmail dot com
New email:
PHP Version: OS:

 

 [2005-10-19 23:50 UTC] cezarsignori at gmail dot com
Description:
------------
The problem is below:

   After a lot of validations i used the function move_uploaded_file on an if instruction, and it returned false, the error returned was 0, and it means "Its all Ok! Your file have been moved!", but there was no file uploaded..
  And YES i have all permissions and how i said the archieve was valid.


Reproduce code:
---------------
		} elseif (!($fcd_medicamento > 0)){
		  $msg_erro = "Choose a medication to associate with the file!";
		}	elseif ((move_uploaded_file($farq_pdf['tmp_name'], "/web/adm/capp/pdf/ ".$farq_pdf['name']))and
         (move_uploaded_file($farq_pdf2['tmp_name'], "/web/adm/capp/pdf/ ".$farq_pdf2['name']))) {
			$sql = "UPDATE sps_medicamento
			        SET arq_resumido='".$farq_pdf['name']."',
			            arq_completo='".$farq_pdf2['name']."'
                 WHERE cd_medicamento = $fcd_medicamento";
  		if(!$DBcon->query($sql)){
  			echo "<b>Problem in the SQL instruction <br>n.o ".$DBcon->erro_num."</b>--->  ".$DBcon->erro_msg."<br>";


Expected result:
----------------
Well i expected to see an error thats not 0, because its mean "No error" or to upload the file.

Actual result:
--------------
The "no error" number error have been printed(0), and the file haven't been uploaded

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-19 23:51 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-10-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 20 21:01:27 2020 UTC