Firstly, the visa application must be submitted to the Spanish Consulate in the country of origin or to the Large Companies Unit in Spain. A vis will be granted for one year, with which you will be able to apply for residence, or for two years if done directly when in Spain.