+
    Tj                         R t ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 . ROt ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R	4      t ! R R
]4      t ! R R]4      tR tR# )zH
Base file upload handler classes, and the built-in concrete subclasses
N)BytesIO)settings)InMemoryUploadedFileTemporaryUploadedFileimport_stringUploadFileException
StopUploadSkipFileFileUploadHandlerTemporaryFileUploadHandlerMemoryFileUploadHandlerStopFutureHandlersc                       ] tR t^tRtRtR# )r   z.
Any error having to do with uploading files.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       T/var/www/idalgo/venv/lib/python3.14/site-packages/django/core/files/uploadhandler.pyr   r      s     	r   c                   4   a  ] tR t^ t o RtRR ltR tRtV tR# )r	   z5
This exception is raised when an upload must abort.
c                    Wn         R# )z
If ``connection_reset`` is ``True``, Django knows will halt the upload
without consuming the rest of the upload. This will cause the browser
to show a "connection reset" error.
Nconnection_reset)selfr   s   &&r   __init__StopUpload.__init__%   s
     !1r   c                .    V P                   '       d   R # R# )z StopUpload: Halt current upload.z,StopUpload: Consume request data, then halt.r   r   s   &r   __str__StopUpload.__str__-   s       5Ar   r   N)F)	r   r   r   r   r   r   r#   r   __classdictcell____classdict__s   @r   r	   r	       s     1B Br   c                       ] tR t^4tRtRtR# )r
   zP
This exception is raised by an upload handler that wants to skip a given
file.
r   Nr   r   r   r   r
   r
   4       
 	r   c                       ] tR t^=tRtRtR# )r   z
Upload handlers that have handled a file and do not want future handlers to
run should raise this exception instead of returning None.
r   Nr   r   r   r   r   r   =   r)   r   c                   ^   a  ] tR t^Ft o RtRtRR ltRR ltRR ltR t	R t
R tR	 tR
tV tR# )r   z+
Base class for streaming upload handlers.
Nc                X    R V n         R V n        R V n        R V n        R V n        Wn        R # N)	file_namecontent_typecontent_lengthcharsetcontent_type_extrarequest)r   r3   s   &&r   r   FileUploadHandler.__init__M   s-     ""&r   c                    R# )af  
Handle the raw input from the client.

Parameters:

    :input_data:
        An object that supports reading via .read().
    :META:
        ``request.META``.
    :content_length:
        The (integer) value of the Content-Length header from the
        client.
    :boundary: The boundary from the Content-Type header. Be sure to
        prepend two '--'.
Nr   r   
input_dataMETAr0   boundaryencodings   &&&&&&r   handle_raw_input"FileUploadHandler.handle_raw_inputU   s    $ 	r   c                N    Wn         W n        W0n        W@n        WPn        W`n        R# )z
Signal that a new file has been started.

Warning: As with any data from the client, you should not trust
content_length (and sometimes won't even get it).
N)
field_namer.   r/   r0   r1   r2   )r   r>   r.   r/   r0   r1   r2   s   &&&&&&&r   new_fileFileUploadHandler.new_filei   s%     %"(,"4r   c                    \        R4      h)zc
Receive data from the streamed upload parser. ``start`` is the position
in the file of the chunk.
zJsubclasses of FileUploadHandler must provide a receive_data_chunk() methodNotImplementedErrorr   raw_datastarts   &&&r   receive_data_chunk$FileUploadHandler.receive_data_chunk   s    
 "X
 	
r   c                    \        R4      h)z
Signal that a file has completed. File size corresponds to the actual
size accumulated by all the chunks.

Subclasses should return a valid ``UploadedFile`` object.
zEsubclasses of FileUploadHandler must provide a file_complete() methodrB   r   	file_sizes   &&r   file_completeFileUploadHandler.file_complete   s     "S
 	
r   c                    R# )zk
Signal that the upload is complete. Subclasses should perform cleanup
that is necessary for this handler.
Nr   r"   s   &r   upload_complete!FileUploadHandler.upload_complete       
 	r   c                    R# )zo
Signal that the upload was interrupted. Subclasses should perform
cleanup that is necessary for this handler.
Nr   r"   s   &r   upload_interrupted$FileUploadHandler.upload_interrupted   rQ   r   )r1   r0   r/   r2   r>   r.   r3   i   r-   )NN)r   r   r   r   r   
chunk_sizer   r;   r?   rG   rL   rO   rS   r   r%   r&   s   @r   r   r   F   s9      J(5,
	
 r   c                   H   a a ] tR t^t oRtV 3R ltR tR tR tRt	Vt
V ;t# )r   z9
Upload handler that streams data into a temporary file.
c                   < \         SV `  ! V/ VB  \        V P                  V P                  ^ V P
                  V P                  4      V n        R# )z;
Create the file object to append to as data is coming in.
N)superr?   r   r.   r/   r1   r2   filer   argskwargs	__class__s   &*,r   r?   #TemporaryFileUploadHandler.new_file   sB     	$)&))NND--q$,,@W@W
	r   c                <    V P                   P                  V4       R # r-   )rY   writerD   s   &&&r   rG   -TemporaryFileUploadHandler.receive_data_chunk   s    		!r   c                p    V P                   P                  ^ 4       WP                   n        V P                   # )    )rY   seeksizerJ   s   &&r   rL   (TemporaryFileUploadHandler.file_complete   s%    		q"		yyr   c                    \        V R 4      '       dN   V P                  P                  4       p V P                  P                  4        \        P
                  ! V4       R# R#   \         d     R# i ; i)rY   N)hasattrrY   temporary_file_pathcloseosremoveFileNotFoundError)r   temp_locations   & r   rS   -TemporaryFileUploadHandler.upload_interrupted   sY    4   II99;M		!		-(	 !
 % s   0A" "A10A1)rY   )r   r   r   r   r   r?   rG   rL   rS   r   r%   __classcell__r]   r'   s   @@r   r   r      s#     
"
 r   c                   L   a a ] tR t^t oRtRR ltV 3R ltR tR tRt	Vt
V ;t# )r   zK
File upload handler to stream uploads into memory (used for small files).
c                6    V\         P                  8*  V n        R# )zN
Use the content_length to signal whether or not this handler should be
used.
N)r   FILE_UPLOAD_MAX_MEMORY_SIZE	activatedr6   s   &&&&&&r   r;   (MemoryFileUploadHandler.handle_raw_input   s     (8+O+OOr   c                ~   < \         SV `  ! V/ VB  V P                  '       d   \        4       V n        \        4       hR # r-   )rX   r?   ru   r   rY   r   rZ   s   &*,r   r?    MemoryFileUploadHandler.new_file   s5    $)&)>>>	DI$&& r   c                d    V P                   '       d   V P                  P                  V4       R# V# )z!Add the data to the BytesIO file.N)ru   rY   r`   rD   s   &&&r   rG   *MemoryFileUploadHandler.receive_data_chunk   s     >>>IIOOH%Or   c           
         V P                   '       g   R# V P                  P                  ^ 4       \        V P                  V P                  V P
                  V P                  VV P                  V P                  R7      # )z2Return a file object if this handler is activated.N)rY   r>   namer/   re   r1   r2   )	ru   rY   rd   r   r>   r.   r/   r1   r2   rJ   s   &&r   rL   %MemoryFileUploadHandler.file_complete   s\    ~~~		q#**LL#66
 	
r   )ru   rY   r-   )r   r   r   r   r   r;   r?   rG   rL   r   r%   rp   rq   s   @@r   r   r      s$     	P'
 
r   c                $    \        V 4      ! V/ VB # )aD  
Given a path to a handler, return an instance of that handler.

E.g.::
    >>> from django.http import HttpRequest
    >>> request = HttpRequest()
    >>> load_handler(
    ...     'django.core.files.uploadhandler.TemporaryFileUploadHandler',
    ...     request,
    ... )
    <TemporaryFileUploadHandler object at 0x...>
r   )pathr[   r\   s   &*,r   load_handlerr      s     ///r   )r   r	   r
   r   r   r   r   r   )r   rk   ior   django.confr   django.core.files.uploadedfiler   r   django.utils.module_loadingr   __all__	Exceptionr   r	   r
   r   r   r   r   r   r   r   r   <module>r      s    
    V 5		) 	B$ B(	" 		, 	Y Yx!2 @+
/ +
\0r   