\IPS\File::Create
public static function create( $storageExtension, $filename, $data=NULL, $container=NULL, $isSafe=FALSE, $filePath=NULL, $obscure=TRUE )
If $container is NULL file created in current month folder.
I do it like this:
$file = \IPS\File::create( $st, $fn, $ri, array_shift(explode("/", $image['attach_location'])) );