Thursday, 22 August 2013

Warning: File upload error - unable to create a temporary file in Unknown on line 0

Warning: File upload error - unable to create a temporary file in Unknown
on line 0

pAm getting the following error everytime I try to upload a file . /p
pWarning: File upload error - unable to create a temporary file in Unknown
on line 0/p pHere is my HTML form,/p precodelt;form
action=./inventory_list.php enctype=multipart/form-data name=myForm
id=myForm method=postgt; lt;table width=625 border=1 cellpadding=5gt;
lt;trgt; lt;td width=84gt;Product Namelt;/tdgt; lt;td width=399gt;lt;input
type=text name=product_name id=product_namegt;lt;/tdgt; lt;/trgt; lt;trgt;
lt;tdgt;Product Pricelt;/tdgt; lt;tdgt;lt;label
for=textfield2gt;Rs:lt;/labelgt; lt;input type=text name=price
id=pricegt;lt;/tdgt; lt;/trgt; lt;trgt; lt;tdgt;Categorylt;/tdgt;
lt;tdgt;lt;select name=category id=categorygt; lt;option value=
selected=selectedgt;lt;/optiongt; lt;option value=Bedroom gt;Bedroom
lt;/optiongt; lt;option value=Livinggt;Living roomlt;/optiongt; lt;option
value=Dininggt;Dininglt;/optiongt; lt;/selectgt;lt;/tdgt; lt;/trgt;
lt;trgt; lt;tdgt;Sub - Categorylt;/tdgt; lt;tdgt;lt;select
name=subcategory id=subcategorygt; lt;option value=
selected=selectedgt;lt;/optiongt; lt;option value=dinetgt;Dining
tableslt;/optiongt; lt;option value=shoegt;shoe rackslt;/optiongt;
lt;option value=wardrobegt;wardrobeslt;/optiongt; lt;option
value=sofagt;sofalt;/optiongt; lt;/selectgt;lt;/tdgt; lt;/trgt; lt;trgt;
lt;tdgt;Product Detailslt;/tdgt; lt;tdgt;lt;textarea name=details cols=50
rows=10 id=detailsgt;lt;/textareagt;lt;/tdgt; lt;/trgt; lt;trgt;
lt;tdgt;Product Imagelt;/tdgt; lt;tdgt;lt;labelgt; lt;input type=file
name=fileField id=fileField/gt; lt;/labelgt;lt;/tdgt; lt;/trgt; lt;trgt;
lt;tdgt;amp;nbsp;lt;/tdgt; lt;tdgt;lt;input type=submit name=button
id=button value=Add this Item nowgt;lt;/tdgt; lt;/trgt; lt;/tablegt;
lt;/brgt; lt;/formgt; /code/pre pHere is my PHP code ,/p precode
if(isset($_POST[product_name])) { $product_name =
mysql_real_escape_string($_POST[product_name]); $price=
mysql_real_escape_string($_POST[price]); $category=
mysql_real_escape_string($_POST[category]); $subcategory=
mysql_real_escape_string($_POST[subcategory]); $details=
mysql_real_escape_string($_POST[details]); //see if duplicate product
exists $sql = mysql_query(select id from products where
product_name='$product_name' limit 1); $product_match =
mysql_num_rows($sql);//count the output if($product_matchgt;0) { echo The
product name already exists; exit(); } $sql= mysql_query(INSERT INTO
`mystore`.`products` (`product_name`, `price`, `details`, `category`,
`subcategory`, `date_added`) VALUES ( '$product_name', '$price',
'$details', '$category', '$subcategory', now());)or die(mysql_error());
$pid = mysql_insert_id(); $newname = $pid.jpg;
move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/$newname');
} /code/pre pAm trying to upload on localhost , Test Server:XAMPP , OS :
MAC 10.8/p pAm stuck on this from a long time , I tried a lot of things
but nothing is working . /p

No comments:

Post a Comment