Preparando as relacoes e upload