Added support for folders in sending to tmp