관리-도구
편집 파일: file_upload.cpython-38.pyc
U (?�f� � @ s� d dl Z d dlZd dlZG dd� d�Zeej�dk rJedejd � e�ejd Zejd Z e j �e �szede � e�e�� Z e �eje� e �ejd� e �ejeee d ��j� e j �e �Ze �eje� ed e ef � e �� e �� dS )� Nc @ s e Zd Zdd� Zdd� ZdS )� FileReaderc C s || _ d S �N)�fp)�selfr � r �^/opt/hc_python/lib64/python3.8/site-packages/../../../share/doc/pycurl/examples/file_upload.py�__init__ s zFileReader.__init__c C s | j �|�S r )r �read)r �sizer r r � read_callback s zFileReader.read_callbackN)�__name__� __module__�__qualname__r r r r r r r s r � z Usage: %s <url> <file to upload>� � z#Error: the file '%s' does not exist�rbzUploading file %s to url %s)�os�sysZpycurlr �len�argv�print� SystemExit�url�filename�path�existsZCurl�cZsetopt�URLZUPLOADZREADFUNCTION�openr �getsize�filesizeZ INFILESIZEZperform�closer r r r �<module> s&