ShareFile
Represents a file to share, either from disk or in-memory bytes.
Properties
Methods
from_bytes- Create ShareFile from raw bytes.from_path- Create ShareFile from a filesystem path.
Properties
pathclass-attributeinstance-attribute
path: Optional[str] = NoneFilesystem path to the file to share.
Methods
from_bytesstaticmethod
from_bytes(data: bytes, mime_type: Optional[str] = None, name: Optional[str] = None)Create ShareFile from raw bytes.
Parameters:
- data (bytes) - Raw bytes of the file.
- mime_type (Optional[str], default:
None) - Optional MIME type of the file. - name (Optional[str], default:
None) - Optional name of the file.