Page 1 of 1

php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 7:18 am
by realite
hi everyone,

My host has been changed a week ago. my codes on my new host about upload file not working. while i'm uploading a file the $_FILES['file']['name'] variable has a value like "blabla.jpg" but the others like $_FILES['file']['size'], $_FILES['file']['tmp_name'] blank. So i cant upload the file.

how can be this??? what should do i??
please helppp :banghead:

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 7:24 am
by hpuiu
What does $_FILES['file']['error'] contain ( usually the error code if any ) ?

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 7:27 am
by realite
result of $_FILES using var_dump function below,

array(1) {
["resim"]=> array(5) {
["name"]=> string(12) "Logo.jpg"
["type"]=> string(0) ""
["tmp_name"]=> string(0) ""
["error"]=> int(6)
["size"]=> int(0)
}
}

so ["error"] valu is BLANK!!

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 8:19 am
by Chris Corbyn
realite wrote:so ["error"] valu is BLANK!!
Is it? :? Looks like integer 6 to me.

http://au2.php.net/manual/en/features.f ... errors.php
The manual wrote: UPLOAD_ERR_NO_TMP_DIR

Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 8:30 am
by realite
OHHh yeahhhh,

yes, you'r right. ı'm waiting for the errr number through that line :)))

So, What can i do for this threat????

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 8:45 am
by Chris Corbyn
http://au2.php.net/manual/en/ini.core.p ... ad-tmp-dir

upload_tmp_dir needs to be set in php.ini. Unfortunately this can't be overridden with a call to ini_set() so you need to speak to your host. If you're using a free host it's possible they've deliberately prevented uploads. Ask your host ;)

Re: php upload problem $post['file']['tmp_name'] is blank!!!

Posted: Mon May 05, 2008 8:57 am
by realite
Chris Corbyn your the one.

Very very thanks. If you come to Turkiye in next time i will be a manservant for u :wink: