geonode.upload.uploadhandler ============================ .. py:module:: geonode.upload.uploadhandler Classes ------- .. autoapisummary:: geonode.upload.uploadhandler.SizeRestrictedFileUploadHandler Module Contents --------------- .. py:class:: SizeRestrictedFileUploadHandler Bases: :py:obj:`django.core.files.uploadhandler.FileUploadHandler` Upload handler exhaust the stream to avoit overload the memory when the file is bigger than the limit set. The upload will be blocked afterwards by the Upload Form .. py:attribute:: elegible_url_names .. py:method:: handle_raw_input(input_data, META, content_length, boundary, encoding=None) We use the content_length to signal whether or not this handler should be used. .. py:method:: _handle_raw_input_without_file_stream(input_data, META, raw_content_length, boundary, encoding=None) Replaces django.http.multipartparser.MultiPartParser.parse A rfc2388 multipart/form-data parser but replacing the file stream to the creation of empty files. Returns a tuple of ``(MultiValueDict(POST), MultiValueDict(FILES))``. .. py:method:: sanitize_file_name(file_name) Same as django.http.multipartparser.MultiPartParser.sanitize_file_name so it's not needed to instantiate a MultiPartParser object just to sanitize the filename of an upload. .. py:method:: _get_max_size(file_type) .. py:method:: receive_data_chunk(raw_data, start) Receive data from the streamed upload parser. ``start`` is the position in the file of the chunk. .. py:method:: file_complete(file_size) Signal that a file has completed. NOTE: When activated, file size DOES NOT corresponds to the actual size. NOTE: When activated, file size IS NOT accumulated by all the chunks. In this case, it represents the total content_length of the request.