We find an exact nonstatic charged BTZ-like solutions, in (N+1)-dimensional Einstein gravity in the presence of negative cosmological constant and a nonlinear Maxwell field defined by a power s of the Maxwell invariant, which describes the gravitational collapse of charged null fluid in an anti-de Sitter background. Considering the situation that a charged null fluid injects into the initially an anti-de Sitter spacetime, we show that a black hole form rather than a naked singularity, irrespective of spacetime dimensions, from gravitational collapse in accordance with cosmic censorship conjecture. The structure and locations of the apparent horizons of the black holes are also determined. It is interesting to see that, in the static limit and when N = 2, one can retrieve 2+1 BTZ black hole solutions.