working upload files and preview