Send correct path on file upload when using public app

Fix issue #7152 

Please review @pvince81 @karlitschek @schiesbn