Dynamic file paths and MIME detection from input stream: