Added the original logic to check for a invalid path and a simple test.
Attach a file by drag & drop or click to upload