Welcome! Log In Create A New Profile

Advanced

[PHP] What is wrong here?

Posted by Karl-Arne Gjersøyen 
Karl-Arne Gjersøyen
[PHP] What is wrong here?
April 25, 2012 06:51AM
Hello again.
I can't figure out what is wrong here.

move_uploaded_file() get error message from die() and can't copy/move
temp_file into directory bilder

I have try to chmod 0777 bilder/ but it did not help.
Also I have try to chown www-data.www-data bilder/ since Ubuntu Server
run apache as www-data user...

Here is my souce code
------------------------------------------------------
// Temfil lagres midlertidig på serveren som
// spesifisert i php.ini
$tmp_fil = $_FILES['filbane']['temp_name'];
// lagre filnavnet..
$filnavn = "bilder/" . $_FILES['filbane']['name'];
// ..og legg fila i katalogen bilder
move_uploaded_file($tmp_fil, $filnavn) or die("Feilmelding: Kunne
ikke flytte $filnavn");


Karl

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[email protected]
Re: [PHP] What is wrong here?
April 25, 2012 10:50AM
"Karl-Arne Gjersøyen" <[email protected]> hat am 25. April 2012 um 06:45
geschrieben:

> Hello again.
> I can't figure out what is wrong here.
>
> move_uploaded_file() get error message from die() and can't copy/move
> temp_file into directory bilder
>
> I have try to chmod 0777 bilder/ but it did not help.
> Also I have try to chown www-data.www-data bilder/ since Ubuntu Server
> run apache as www-data user...
>
> Here is my souce code
> ------------------------------------------------------
> // Temfil lagres midlertidig på serveren som
> // spesifisert i php.ini
> $tmp_fil = $_FILES['filbane']['temp_name'];

tmp_name not temp_name

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stuart Dallas
Re: [PHP] What is wrong here?
April 25, 2012 10:50AM
On 25 Apr 2012, at 09:45, marco@behnke.biz wrote:

> "Karl-Arne Gjersøyen" <[email protected]> hat am 25. April 2012 um 06:45
> geschrieben:
>
>> Hello again.
>> I can't figure out what is wrong here.
>>
>> move_uploaded_file() get error message from die() and can't copy/move
>> temp_file into directory bilder
>>
>> I have try to chmod 0777 bilder/ but it did not help.
>> Also I have try to chown www-data.www-data bilder/ since Ubuntu Server
>> run apache as www-data user...
>>
>> Here is my souce code
>> ------------------------------------------------------
>> // Temfil lagres midlertidig på serveren som
>> // spesifisert i php.ini
>> $tmp_fil = $_FILES['filbane']['temp_name'];
>
> tmp_name not temp_name

This indicates that you're developing with notices switched off. This is a very bad idea because it hides simple errors like this. See the manual for details: http://php.net/error_reporting.

-Stuart

--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login