proper procedure for adding a file from frontend