메뉴 건너뛰기

app

[xcode] 이미지 파일 업로드하기

박영식2010.09.21 02:56조회 수 6666댓글 0

  • 2
    • 글자 크기
http://www.ifon.no/eksterne-nyheter/getting-images-iphone-photo-library-or-c  앱 다운로드

http://iphone.zcentric.com/category/uncategorized/  업로드 소스 참조

http://www.weez.com/2010/04/xcode-tutorial-uploading-images-to-a-site/   동영상 강좌

한 사이트에서 해결이 안 되서 돌아다녔다.


[PhotoAppViewController.m]
pushUpload 의 url 은 자신의 계정을 입력한다.

NSString *urlString = @"http://url/up.php";


[up.php] 는 아래와 같고, 디렉터리는 파일을 업로드할 수 있도록 퍼미션을 설정해 줘야 한다.

<?
$uploaddir = '/절대경로/';
$file = basename($_FILES['userfile']['name']);
$uploadfile = $uploaddir . $file;
if (!is_uploaded_file($_FILES['userfile']['tmp_name'])) {
        exit("File was not uploaded to temporary directory!");
}
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
        echo "http://경로/{$file}";
}
?>

박영식 (비회원)
  • 2
    • 글자 크기
[xcode] tabView에 간단히 다른 뷰 추가하기 (by 박영식) [xcode] 스크롤뷰 사용하기 (by 박영식)

댓글 달기

이전 1 ... 3 4 5 6 7 8 9 10 11 12... 14다음
첨부 (2)
PhotoApp.zip
709.9KB / Download 147
78.jpg
85.3KB / Download 62
위로