handle relative paths and create download link