Both are correct. It depends on whether the forces are extensive or compressive.
However, very often in free body diagrams, the forces marked on the diagram represent force direction acting on an object given by a string/spring, NOT the direction of force acting on the string/spring.