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

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
realite
Forum Newbie
Posts: 5
Joined: Mon May 05, 2008 2:31 am
Location: Turkiye

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

Post 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:
hpuiu
Forum Newbie
Posts: 2
Joined: Mon May 05, 2008 6:50 am

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

Post by hpuiu »

What does $_FILES['file']['error'] contain ( usually the error code if any ) ?
realite
Forum Newbie
Posts: 5
Joined: Mon May 05, 2008 2:31 am
Location: Turkiye

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

Post 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!!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

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

Post 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.
realite
Forum Newbie
Posts: 5
Joined: Mon May 05, 2008 2:31 am
Location: Turkiye

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

Post 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????
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

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

Post 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 ;)
realite
Forum Newbie
Posts: 5
Joined: Mon May 05, 2008 2:31 am
Location: Turkiye

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

Post 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:
Post Reply