Warning: file_get_contents(C:\xampp\tmp\php4C4F.tmp): failed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mohit5616
Forum Newbie
Posts: 1
Joined: Mon Feb 27, 2017 12:33 am

Warning: file_get_contents(C:\xampp\tmp\php4C4F.tmp): failed

Post by mohit5616 »

hello sir/i am from india ,i face the problem with warning ,Warning: file_get_contents(C:\xampp\tmp\php4C4F.tmp): failed to open stream: No such file or directory in C:\xampp\htdocs\Image_upload\newimage.php on line 15 . Help me to identified the error.


Code: Select all

<?php
include('con_ini.php');
if(isset($_POST['submit']))
{
	//print_r($_FILES['filename']);
	$image=$_FILES['filename']['name'];
	echo $image_tmp=$_FILES['filename']['tmp_name'];
	$image_type=$_FILES['filename']['type'];
	$image_size=$_FILES['filename']['size'];
	
	$store="Tmp/".$image;
	$var=move_uploaded_file($image_tmp,$store);
	echo '<br>uploaded!';
	$file=file_get_contents($image_tmp);
	$query=mysql_query('insert into folder(image_name)values($file)',$conn);
	if(!$query)
	{
		die(mysql_error());
	}
	else
	{
	$row=mysql_fetch_row($query);
	echo $row[1];
	}
	}
?>
<html>
<body> 
<form action="newimage.php" method="post" enctype="multipart/form-data">
<p><input type="file" name="filename" /></p>
<p><input type="submit" value="upload" name="submit" /></p>
</form>
</body>
</html>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Warning: file_get_contents(C:\xampp\tmp\php4C4F.tmp): fa

Post by requinix »

You can't file_get_contents something after you've move_uploaded_file it somewhere else, but you can get the file at its new location.
Post Reply