Advertisement

10.12.2008 at 12:44AM PDT, ID: 23807429 | Points: 125
[x]
Attachment Details

php file uploading error

Asked by amitbravo in PHP Scripting Language, PHP for Windows, PHP and Databases

Tags:

I used a simple php script to upload a file .. look at code snippet.

its works well on my one server whereas not on another .. there is kind of error i got on second one:

Warning: move_uploaded_file(myimg.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/gseonet/public_html/fileload.php on line 22

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpmO0lpp' to 'myimg.jpg' in /home/gseonet/public_html/fileload.php on line 22

though i can see GD is enabled
you can directly check it here >
http://www.gseo.net/fileload.php

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
if($_POST['Submit']){
$img_url1_name=trim($_FILES['img_url1']['tmp_name']);
		$img_url1_type=trim($_FILES['img_url1']['type']);
		$img_url1_size=trim($_FILES['img_url1']['size'])/1024;
 
$type1=explode("/",$img_url1_type);
 
// $uploaddir = "/home/gseonet/public_html/images/profile/";
// $uploaddir = "images/profile/";
		//$image = "myimg".".".$type1[1];
		//$uploadfile = $uploaddir . $image;
		$image="myimg.jpg";
 
		move_uploaded_file($img_url1_name, $image);
	//	move_uploaded_file($img_url1_name, $uploadfile);
		
		}
?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input name="img_url1" type="file" id="img_url1" />
  <input type="submit" name="Submit" value="Submit" />
</form>
<p>&nbsp;</p>
<?php 
echo phpinfo();
?>
</body>
</html>
 
 
[+][-]10.12.2008 at 02:16AM PDT, ID: 22696784

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]10.12.2008 at 02:58AM PDT, ID: 22696856

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]10.12.2008 at 10:09AM PDT, ID: 22698071

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]10.12.2008 at 02:37PM PDT, ID: 22698975

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]11.16.2008 at 12:30PM PST, ID: 22971864

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628