Advertisement

08.03.2008 at 12:23PM PDT, ID: 23617520
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

PHP File Upload not working as expected

Asked by rbbrownlee in PHP Scripting Language, PHP for Windows

Tags:

Hi All,
I'm pulling what little hair I have left out on this one.  Perhaps a fresh set of eyes on it would help.

I have a VPS through HostMySite (just in case this matters).

I have been trying for the last hour to figure out what is wrong with this code.

I have set the IUSR_TEMPLATE user to full read & write access on both folders on the server that is supposed to have the upload file and the location where the file is to be moved.  

Please check this code and see if I am missing something.  When I look on the server, I can not find a file called D:\TEMP\php69.tmp.

The Result of the echos are as follows:
error: 0
uploadfile: d:\inetpub\wwwroot\hotjupitersites\tecniplast\_imports\products\active_bg.gif
temp_name: D:\TEMP\php69.tmp

The PHP error is:
PHP Warning: move_uploaded_file(d:\inetpub\wwwroot\hotjupitersites\tecniplast\_imports\products\active_bg.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\inetpub\wwwroot\hotjupitersites\tecniplast\_components\update.php on line 41 PHP Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\TEMP\php69.tmp' to 'd:\inetpub\wwwroot\hotjupitersites\tecniplast\_imports\products\active_bg.gif' in D:\inetpub\wwwroot\hotjupitersites\tecniplast\_components\update.php on line 41

When I print_r $file['productsummaryimage']) I get:
Array ( [name] => active_bg.gif [type] => image/gif [tmp_name] => D:\TEMP\php69.tmp [error] => 0 [size] => 13136 )Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function updateProduct($request,$files,$application){
	$productsummaryimage = '';
	
	if(isset($files['productsummaryimage'])){// UPLOAD NEW IMAGE
		$productsummaryimage = $files['productsummaryimage']['name'];
		if($productsummaryimage !== ''){
			$uploadfile = $application['root'] . '_imports\\products\\' . $productsummaryimage;
			
			echo 'error: ' . ($files['productsummaryimage']['error']) . '<br>' ;
			echo 'uploadfile: ' . $uploadfile . '<br>';
			echo 'temp_name: ' .  $files['productsummaryimage']['tmp_name'] . '<br>';
			
			$moved = move_uploaded_file($files['productsummaryimage']['tmp_name'], $uploadfile);
		}
	}
}
[+][-]08.03.2008 at 01:05PM PDT, ID: 22148678

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, PHP for Windows
Tags: PHP, Windows IIS
Sign Up Now!
Solution Provided By: LordOfPorts
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.03.2008 at 02:46PM PDT, ID: 22148986

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628