Distributed photovoltaic generators (DPGs) have been integrated into the medium/low voltage distribution network widely. Due to the randomness and fluctuation of DPG, however, the distribution and direction of power flow are changed frequently on some days. Therefore, more attention is needed to ensure the safe operation of the distribution network. The installation of energy storage systems (ESSs) can help the network to withstand the fluctuations caused by DPG. Based on the discrete Fourier transform method, this paper presents an ESS capacity allocation strategy for the medium/low voltage distribution network with DPG. The reliability scenario models are created via Latin hypercube sampling with Cholesky decomposition and scenario reduction. Numerical results show that the proposed strategy can reduce the power flow fluctuation with less ESS capacity, and increase the penetration capacity of DPG in the distribution network while maintaining the quality of the power supply.