Ezhil
Initial commit
2ed4404
raw
history blame contribute delete
449 Bytes
import streamlit as st
def validate_file(uploaded_file, max_size_mb):
"""
Validates the uploaded file size.
:param uploaded_file: The uploaded file object.
:param max_size_mb: The maximum allowed file size in MB.
:return: True if file size is within limit, else False.
"""
max_size_bytes = max_size_mb * 1024 * 1024 # Convert MB to Bytes
if uploaded_file.size > max_size_bytes:
return False
return True