Yii Framework Forum: Tanya Cara Upload file??? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Tanya Cara Upload file??? Rate Topic: -----

#1 User is offline   robertus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-July 10

Posted 08 August 2010 - 12:00 PM

saya dah coba2 semua extension buat upload file, kok hasilnya error semua.. ada yang tau extension mana yang gampang dan bagus?? sekalian tunjukkin caranya gmana.. Thanx ;D
0

#2 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 08 August 2010 - 10:49 PM

klo yg simple kya gini :

model
public $image_head;  // set ini jika field tdk ada di table.

protected function afterSave()
{
	parent::afterSave();

	if($_FILES['image_head']['size'] != 0)
		move_uploaded_file($_FILES['image_head']['tmp_name'], "files/header/" . $this->id .".jpg");
			
	$this->arrayMenu();

}


view
<?php echo CHtml::activeFileField($model,'image_head'); ?>



jangan lupa kasih 'enctype'=>'multipart/form-data' di form. Posted Image
0

#3 User is offline   robertus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-July 10

Posted 09 August 2010 - 12:22 AM

WOW.. thanx.. dah bisa.. ^^
0

#4 User is offline   ir1971 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-November 10

Posted 10 November 2010 - 09:44 PM

View Postrobertus, on 09 August 2010 - 12:22 AM, said:

WOW.. thanx.. dah bisa.. ^^


bagi2 dong code/cara untuk upload file.
thx
0

#5 User is offline   Br4m 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 25-October 10

Posted 28 March 2011 - 05:16 AM

View Postir1971, on 10 November 2010 - 09:44 PM, said:

bagi2 dong code/cara untuk upload file.
thx


Hi ir1971:

Berikut beberapa contoh upload file:



Semoga membantu
0

#6 User is offline   rin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 21-July 11

Posted 22 July 2011 - 09:51 PM

wah terimaksih semua nya :-D.
0

#7 User is offline   Mr. Ravero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 30-April 13
  • Location:West Java

Posted 02 July 2013 - 01:18 AM

Makasih ;D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users