메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


<< /opt/cloudera/parcels/CDH/lib/hue/apps/filebrowser/src/filebrowser/views.py >>


......


def trash_purge(request):

    return generic_op(TrashPurgeForm, request, request.fs.purge_trash, [], None)



#gooper 2026.5.21

ALLOWED_EXTENSIONS={'.csv','.txt','.parquet','.json','.avro','.orc'}


@require_http_methods(["POST"])

def upload_file(request):

    """

    A wrapper around the actual upload view function to clean up the temporary file afterwards if it fails.


    Returns JSON. e.g. {'status' 0/1, data:'message'...} """

    response = {'status': -1, 'data': ''}


    #gooper start

    if request.method == 'POST':

        upload = request.FILES.get('hdfs_file')

        if upload:

            import os

            ext = os.path.splitext(upload.name)[1].lower()

            if ext not in ALLOWED_EXTENSIONS:

                logger.exception('gooper : extention ('+ext+') is not supported : ')

                response['status']=-1

                response['data']='지원되지 않는 확장자입니다: '+ext

                if upload and hasattr(upload, 'remove'):

                    upload.remove()

                return JsonResponse(response)

    #gooper end


    try:

        resp = _upload_file(request)

        response.update(resp)

    except Exception as ex:

        logger.exception('Upload failure')

        response['data'] = smart_str(ex).split('\n', 1)[0]

        hdfs_file = request.FILES.get('hdfs_file')

        if hdfs_file and hasattr(hdfs_file, 'remove'): # TODO: Call from proxyFS

            hdfs_file.remove()


    return JsonResponse(response)



def _upload_file(request):

......

번호 제목 날짜 조회 수
20 How to Install Magento 2.4.7 on Ubuntu 24.04 2024.09.04 11829
19 [Kerberos]Kerberos authentication cache를 FILE로 지정해도 KCM으로 저장되는 경우 조치방법 2024.11.03 12507
18 외부에서 ImpalaJDBC42.jar를 통해서 Impala에 접속시 sessions정보 2024.11.26 10076
17 Failed to resolve 'acme-v02.api.letsencrypt.org' ([Errno -3] Temporary failure in name resolution)" 2024.11.27 12631
16 beeline을 이용한 impala JDBC 테스트 방법(Kerberos 설정된 상태임) 2024.11.29 7896
15 Oracle 10g 혹은 12c 를 19c로 Upgrade시 Cloudera Cluster작업에 필요한 작업 2025.01.12 11553
14 운영계 하둡클러스터에 노드 4대를 EdgeNode로 추가하는 방법/절차 2025.01.12 12624
13 Apache Kudu에서 동일한 이름의 테이블을 반복적으로 DROP → CREATE → INSERT하는 로직을 2분 간격으로 10회 수행할 때 발생할 수 있는 주요 이슈 2025.01.26 13209
12 [Shellscript]Impala view의 실제 참조 테이블 추출용 shellscript파일 2025.03.22 6644
11 엑셀에서 K ,M, G ,T 단위를 숫자로 변환 하는 수식 2025.04.09 10804
10 [Hue-Oozie]Hue에서 Oozie Coordinator를 export후 import시 "Problen installing fixture" 오류 발생시 조치 2025.10.19 7975
9 [AD]Active Directory의 모든 멤버 정보 추출하는 window powershell script 2025.10.19 7749
8 [sql]table이 사용된 건수를 query history table에서 카운트 하는 방법 2025.11.09 4373
7 [HUE]CDP7.1.9SP1이상에서는 AD 계정에 매핑된 group이 없으면 Hue 로그인 자제가 안된다 2025.11.25 6944
6 [CDP7.1.7] Ranger에서 DB단위로 귄한 부여시 특정 table을 제외하는 벙법 2025.11.25 7077
5 [CDP7.1.7SP1[Ranger Policy를 DB table에서 직접 수정하는 방법 2025.11.26 4340
4 [ActiveDirectory]Get-ADGroupMember를 이용하여 그룹에 속하는 사용자 목록 추출하는 방법 2026.02.12 4207
3 oracle 환경에서 hue desktop_document_cleanup 돌리는 방법 new 2026.05.21 7
2 hue의 filebrowser기능 src파일 수정하는 방법 new 2026.05.21 10
» hue의 filebrowser의 파일업로드 전에 확장자 체크 하여 업로드 못하게 하는 방법 new 2026.05.21 9
위로