help connecting Arduino UNO to n-ch MOSFET via Optocoupler

Please excuse my n00bishness, but wont the power from the supply be too much for the gate of the FET? When using solenoid it will be 15V+. Or will the FET take it?

Grumpy_Mike:
The transistor in an opto coupler can only pull down, so there is nothing to supply the voltage to the FETs gate.

But how come it worked for led? If it pulls down, shouldnt the led then be on when its supposed to be off and off when its supposed to be on?

Edit: Ok, I found this image
But I dont understand how optocoupler will survive the high voltage.