phpDocumentor php-net
[ class tree: php-net ] [ index: php-net ] [ all elements ]

Class: Upload

Source Location: /php/net/Upload.php

Class Upload

Class Overview

파일 업로드 관련 클래스

form 에서 enctype 이 multipart/form-data 형태로 온 데이타를 조작 합니다.

Located in /php/net/Upload.php [line 18]

PObject
   |
   --Upload
Author(s):
API Tags:
Name:  Upload

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From PObject

PObject::__construct()
생성자
PObject::display()
객체 문자열을 출력
PObject::equals()
객체 비교 (수정 필요)
PObject::getClass()
PObject::getObjValue()
객체인지 아닌지 판별해서 PObject 형 객체이면 toString() 메소드로 문자열을 반환하고 일단 자료형이면 그 형태 그대로 리턴한다
PObject::isObject()
객체 확인
PObject::toString()
객체 문자열로 변환
PObject::__toString()
magic methods 추가 , toString() 의 값을 그대로 리턴한다.

[ Top ]
Method Summary
Upload   __construct()   생성자
void   display()   파일 업로드 현황 보여주기
string   get()   업로드 된 파일 속성 얻어오기 , 몇가지 기능이 추가 됩니다.
int   getCount()   파일 업로드 개수 얻어오기
int   move()   업로드한 파일 옮기기
int   moveAll()   업로드한 파일 모두 옮기기
int   moveAllUrl()   업로드한 파일 해당 경로로 모두 옮기기

[ Top ]
Methods
Constructor __construct  [line 34]

  Upload __construct( $field $field, [$isArray $isArray = false]  )

생성자

$upload = new Upload('userfile'); // 한개 파일 업로드 할 때 $upload = new Upload('userfile', true); // 여러개 파일 업로드 할 때

Parameters:
$field   $field:  string form 에서 input type="file" 태그의 이름
$isArray   $isArray:  bool false : 배열이 아님, true : 파일을 배열로 보냄

API Tags:
Access:  public


Redefinition of:
PObject::__construct()
생성자

[ Top ]
display  [line 188]

  void display( )

파일 업로드 현황 보여주기


API Tags:
Access:  public


Redefinition of:
PObject::display()
객체 문자열을 출력

[ Top ]
get  [line 87]

  string get( $type $type, [$i $i = 0]  )

업로드 된 파일 속성 얻어오기 , 몇가지 기능이 추가 됩니다.

php에서 지원하는 파일 속성

name 원본 파일 이름 type MIME Type size 파일 크기 tmp_name 임시파일 이름 error 에러코드 , 에러 코드 값은 php 메뉴얼 참조

확장된 속성

filename 확장자를 제외한 파일 이름 ext 파일 확장자

ex)

$upload = new Upload('userfile'); echo $upload->get('name');

Parameters:
$type   $type:  string 파일 속성 (name, type, size, tmp_name, error, filename, ext)
$i   $i:  int 파일 순서

API Tags:
Return:  각각의 타입별 속성 값
Access:  public


[ Top ]
getCount  [line 52]

  int getCount( )

파일 업로드 개수 얻어오기


API Tags:
Return:  파일 업로드 개수
Access:  public


[ Top ]
move  [line 119]

  int move( [ $file = ''], [ $i = 0]  )

업로드한 파일 옮기기

Parameters:
   $file: 
   $i: 

API Tags:
Return:  파일 업로드 개수
Access:  public


[ Top ]
moveAll  [line 139]

  int moveAll( [@arrFile $arrFile = array()]  )

업로드한 파일 모두 옮기기

Parameters:
@arrFile   $arrFile:  array 옮길 파일명 리스트

API Tags:
Return:  파일 업로드 개수
  1. 이면 전체 업로드 성공
  2. 이상이면 파일 업로드 에러난 번호
Access:  public


[ Top ]
moveAllUrl  [line 166]

  int moveAllUrl( @url $url  )

업로드한 파일 해당 경로로 모두 옮기기

$upload->moveAllUrl('/home/cyberuls/');

Parameters:
@url   $url:  string 옮길 주소

API Tags:
Return:  파일 업로드 개수
  1. 이면 전체 업로드 성공
  2. 이상이면 파일 업로드 에러난 번호
Access:  public


[ Top ]

Documentation generated on Fri, 09 Apr 2010 11:57:35 +0900 by phpDocumentor 1.4.3