before upload on server