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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 - 41 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC