[SOLVED]upload file ke server localhost selalu error

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
yudha7x
Posts: 38
Joined: 05 Apr 2012, 08:45
Location: /var/www/
Contact:

[SOLVED]upload file ke server localhost selalu error

Postby yudha7x » 28 May 2012, 08:28

kk2 master ubuntu,
ane mau tanya nih soal website
ane kan buat web, ane buat source code buat upload file ke web server localhost (apache2)
udah ane coba pake modifikasi2 source code
ane udah pake yg paling sederhana malahan
mesti kok ttp error ya ?

contoh script ane di upload.php



udah, gtu aja, simple kan ?
kok ttp error ya ?
udah ane coba juga tuh chmode folder2 n file2nya ke 775 ttp ga bisa -_-"
apa ada yang salah sm source code saya ?
apa mungkin ada yang kurang untuk setting phpnya ?

mohon bantuannya y kk
trimakasih :)
User avatar
wonk4rol
Posts: 170
Joined: 30 Jul 2010, 11:01
Location: Indramayu, Indonesia
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby wonk4rol » 28 May 2012, 08:48

errornya gimana?
User avatar
yudha7x
Posts: 38
Joined: 05 Apr 2012, 08:45
Location: /var/www/
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby yudha7x » 28 May 2012, 11:05

gni kak
errornya itu mesti tulisannya gagal (di kondisi if else), padahal srcnya btul
terus pas aku tampilin error kodenya yg tampil 0
tapi filenya ga ada di folder yg tmpt upload tadi
User avatar
wonk4rol
Posts: 170
Joined: 30 Jul 2010, 11:01
Location: Indramayu, Indonesia
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby wonk4rol » 28 May 2012, 13:52

boleh coba liat kode nya.
User avatar
yudha7x
Posts: 38
Joined: 05 Apr 2012, 08:45
Location: /var/www/
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby yudha7x » 28 May 2012, 14:36

-----------------------------------
[color:#990000]index.php :[/color]
-----------------------------------
[color:#660000]



Filename:







[/color]

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-----------------------------------
[color:#006600]upload.php[/color]
-----------------------------------
[color:#009900][/color]


udah gini aja kak
aku nyari2 juga ttp aja, suruh chmod folder uploadnya jd 777 udah aku lakuin

outputnya gini:
gagal 0
User avatar
wonk4rol
Posts: 170
Joined: 30 Jul 2010, 11:01
Location: Indramayu, Indonesia
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby wonk4rol » 28 May 2012, 15:39

coba upload.php nya diubah jadi kaya gini. terus apa errornya?
User avatar
ullakx
Posts: 109
Joined: 18 Jul 2010, 06:11
Location: /var/www
Contact:

Re: [ask]upload file ke server localhost selalu error

Postby ullakx » 28 May 2012, 15:46

[quote=yudha7x]
if (move_uploaded_file($tmp, 'file/'.$name))


apakah folder "file" sudah ada (di create) di dalam folder script Anda??