Skip to main content

Module file_uploading

Module file_uploading 

Source
Expand description

Helper functions related to uploading to file storage.

Re-exportsΒ§

pub use crate::domain::authorization::AuthorizationToken;

StructsΒ§

ExerciseServiceUploadCleanup
Tracks uploaded object paths for cleanup when the batch fails.
ExerciseServiceUploadMetadata πŸ”’
ExerciseServiceUploadResultEntry
ExerciseTaskInfo

EnumsΒ§

FileType πŸ”’
StoreKind

ConstantsΒ§

DEFAULT_FILE_SIZE_LIMIT πŸ”’
EXERCISE_UPLOAD_MAX_BATCH_BYTES πŸ”’
EXERCISE_UPLOAD_MAX_FILES πŸ”’
EXERCISE_UPLOAD_MAX_FILE_BYTES πŸ”’
FILE_SIZE_LIMITS πŸ”’

FunctionsΒ§

consume_exercise_upload_bytes πŸ”’
delete_file_from_storage
generate_audio_path πŸ”’
Generates a path for an audio file with the appropriate extension.
generate_file_path πŸ”’
Generates a path for a generic file with the appropriate extension based on its filename.
generate_image_path πŸ”’
Generates a path for an image file with the appropriate extension.
get_size_limit_for_mime πŸ”’
limited_exercise_upload_stream πŸ”’
Returns a side channel for typed upload-limit errors because the stream yields anyhow errors. Callers must inspect it after upload_stream returns.
make_filename_safe πŸ”’
nested_path πŸ”’
path πŸ”’
process_exercise_service_upload
Processes an upload from an exercise service or an exercise iframe. This function assumes that any permission checks have already been made.
upload_certificate_svg
upload_exercise_archive
upload_field_from_cms
Processes an upload from CMS.
upload_field_to_storage πŸ”’
Uploads the data from the multipart field to the given path in file storage.
upload_file_from_cms
Processes an upload from CMS.
upload_file_to_storage πŸ”’
upload_file_to_storage_in_existing_transaction πŸ”’
upload_image_for_organization
Processes an upload for an organization’s image.
validate_exercise_upload_file_count πŸ”’
validate_exercise_upload_filename πŸ”’
validate_exercise_upload_id πŸ”’
validate_exercise_upload_not_empty πŸ”’
validate_media_headers πŸ”’
Generates a path for an audio file with the appropriate extension.