geonode.upload.uploadhandler
Classes
Upload handler exhaust the stream to avoit overload the memory when the file is bigger than the limit set. |
Module Contents
- class geonode.upload.uploadhandler.SizeRestrictedFileUploadHandler[source]
Bases:
django.core.files.uploadhandler.FileUploadHandlerUpload 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
- handle_raw_input(input_data, META, content_length, boundary, encoding=None)[source]
We use the content_length to signal whether or not this handler should be used.
- _handle_raw_input_without_file_stream(input_data, META, raw_content_length, boundary, encoding=None)[source]
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)).
- sanitize_file_name(file_name)[source]
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.