Forum Smadav
December 19, 2014, 06:04:37 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Smadav adalah antivirus untuk proteksi tambahan komputer Anda, proteksi 100% USB Flashdisk, dan pembersihan tuntas virus yang menyebarluas.
 
   Home   Help Search Shop Members Login Register  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: [ SHARE ] Upload File Ke Server Dengan PHP  (Read 2220 times)
Muhammad Rifqi



Reputation Power: 8084
Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi
Offline Offline

Gender: Male
Posts: 910
$7495 SmadPoint

Send Money to Muhammad Rifqi

Copyright © 2015 AVANSI Soft.


View Profile WWW
« on: June 19, 2012, 12:07:33 AM »

Salah satu keunggulan yang dimiliki php adalah upload file ke server yang dapat dilakukan dengan mudah. Syntax untuk upload adalah :

Code:
move_uploaded_file($filename,$destination)

$filename adalah string lokasi file yang ingin diupload (pada komputer)
$destination adalah string lokasi tujuan file akan disimpan (pada server)

Sebelum membuat script upload, kita buat terlebih dahulu script berisi form untuk memilih file yang ingin diupload. Buatlah script form_upload.php seperti di bawah ini :

Code:
<form enctype="multipart/form-data" method="post" action="upload.php">
   Pilih File : <input type="file" name="txtupload"><br>
  <input type=submit value=Upload>
</form>

Sekarang buat scrip upload.php :

Code:
<?php
  $filename 
$_FILES['txtupload']['tmp_name'];
  
$nama_file $_FILES['txtupload']['name'];
  
$destination "files/$nama_file";
  if (
move_uploaded_file($filename,"$destination")){
    echo 
"<b>$nama_file</b> berhasil di upload !!<br>";
  }else{
    echo 
"File gagal diupload !!";
  }
?>

Pada $destination berisi files/$nama_file yang artinya file yang diupload diletakkan di folder files.
Sehingga anda harus membuat folder dengan nama files yang diletakkan satu folder dengan script form_upload.php dan upload.php. Script tersebut merupakan script upload yang paling sederhana, hanya menggunakan properti name dan tmp_name.
Selamat mencoba . . .  Wink Wink

+3
« Last Edit: June 19, 2012, 12:14:02 AM by ◦◦◦ Rifqi_Sah ™ ◦◦◦ » Balas

Download AVANSI Antivirus 2015 NEW in : http://www.avansi.tk/ Recomended metal Smiley
Ryan BeKaBe
Admin

*******

Reputation Power: 12857
Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe Ryan BeKaBe
Offline Offline

Posts: 1.726
$12237 SmadPoint

Send Money to Ryan BeKaBe

ToS (Team of SmadAV)


View Profile WWW
« Reply #1 on: June 19, 2012, 09:12:41 AM »

Dan setelah diimprovisasi, maka melalui File Uploader tadi kita bisa membuat Online Scanner tak lupa bisa juga dilengkapi dengan fungsi Cure/Healernya, untuk contohnya di : www.ryan.byethost15.com/bkbcureit

Cheesy
Happy coding.

0
Balas

Kembangkan dan aplikasikan imajinasi mu!
Janganlah kau biarkan layu!
I believe you can do it!
|

Rajanya Ikan Bakar
Muhammad Rifqi



Reputation Power: 8084
Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi
Offline Offline

Gender: Male
Posts: 910
$7495 SmadPoint

Send Money to Muhammad Rifqi

Copyright © 2015 AVANSI Soft.


View Profile WWW
« Reply #2 on: June 19, 2012, 10:39:15 AM »

oke oke Cheesy Cheesy

+1
Balas

Download AVANSI Antivirus 2015 NEW in : http://www.avansi.tk/ Recomended metal Smiley
derit



Reputation Power: 189
derit derit
Offline Offline

Gender: Male
Posts: 22
$173 SmadPoint

Send Money to derit


View Profile WWW
« Reply #3 on: June 30, 2012, 10:12:36 PM »

nice....

-1
Balas
★ harboot ★
Smadav Experts

*******

Reputation Power: 34690
★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★ ★ harboot ★
Offline Offline

Gender: Male
Posts: 5.144
$34182 SmadPoint

Send Money to ★ harboot ★

harboot.com


View Profile WWW
« Reply #4 on: July 01, 2012, 12:06:00 AM »

Saya suka pakai Thingie..
Upload Manager,, (attachment file PHP)

Sekarang klo buka web-nya
http://www.solitude.dk/filethingie/

Sudah di Upgrade jadi lebih waaah..

  • Upload multiple files at once
  • Multiple users and user groups
    • Create subdirectories
    • Rename, move, delete and copy files and folders
      • Search for file and folder names
      • Control access to files based on black- or whitelists
        • Edit text files
        • Unzip files without downloading
          • Easy customization of the CSS based layout
          • Translate into your own language

+1
Balas

Rifki_D



Reputation Power: 3

Offline Offline

Posts: 1
$3 SmadPoint

Send Money to Rifki_D

View Profile
« Reply #5 on: June 21, 2013, 06:05:24 AM »

makasih gan, ini yg ane carii ...

-1
Balas
Demetrios Manella



Reputation Power: 728
Demetrios Manella Demetrios Manella Demetrios Manella Demetrios Manella
Offline Offline

Gender: Male
Posts: 116
$672 SmadPoint

Send Money to Demetrios Manella

Mau istirahat dulu jadi programmer :)


View Profile WWW
« Reply #6 on: June 21, 2013, 08:25:32 AM »

Ups, aku salah masuk nih.,.,, aku kan gak ngerti PHP... Cheesy

0
Balas

Follow me on Twitter: @theSyahputera7
Visit my blog: http://dsyahputera7.mywapblog.com
Muhammad Rifqi



Reputation Power: 8084
Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi Muhammad Rifqi
Offline Offline

Gender: Male
Posts: 910
$7495 SmadPoint

Send Money to Muhammad Rifqi

Copyright © 2015 AVANSI Soft.


View Profile WWW
« Reply #7 on: July 06, 2013, 07:23:30 AM »

kwkw gapa gan Cheesy

+1
Balas

Download AVANSI Antivirus 2015 NEW in : http://www.avansi.tk/ Recomended metal Smiley
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.347 seconds with 23 queries. (Pretty URLs adds 0.107s, 2q)