PARIS (AP) _ A French court on Thursday charged five military men with threatening national defense by leaking information to the press about the sinking of the Greenpeace flagship Rainbow Warrior.

The newsmagazine l'Express, meanwhile, reported in its Friday edition that documents related to the Greenpeace scandal, reported by the goverment to have been destroyed, are still in existence.

Yann de l'Ecotais, the editor of L'Express, said in a radio broadcast that his information came ''from very good sources.''

The report contradicts statements by Defense Minister Paul Quiles, who took office Friday after his predecessor, Charles Hernu, resigned. Quiles has said that important documents on the July 10 sinking had been destroyed. The contents of the documents have not been made known.

Four of those charged Thursday were identified as Col. Joseph Fourrier, 57; Capt. Alain Borras, 34; Warrant-Officer Richard Guillet, 32; and Master- Sergeant Bernard Davier, 27, all current or former members of the General Directorate for External Security, the spy agency involved in the sinking.

The fifth man, who was charged later in the day, was national police Capt. Paul Barril, 39, believed to have acted as an intermediary between the press and the four secret service men. The national police are a branch of the military.

All five formally were charged with ''revealing information of a nature to harm national defense ... without intention of treason or espionage,'' a charge which carries a maximum sentence of five years in jail.

Although it is clear the government would like to leave the Greenpeace affair behind, particularly with the four-day visit of Soviet leader Mikhail S. Gorbachev set to begin Oct. 2, the matter is not entirely in the administration's hands.

A parliamentary commission is to begin an independent investigation, and on Nov. 4, the trial of two French agents held in New Zealand on murder and criminal arson charges is scheduled to begin.

On Thursday afternoon, President Francois Mitterrand, who has tried to remain aloof from the Greenpeace affair, issued a brief statement saying he believed Prime Minister Laurent Fabius had made ''the necessary statements to bring light to this affair.''

Fabius said Wednesday night on television that Hernu and former secret service chief, Adm. Pierre Lacoste, bore responsibility for the order that led French agents to sink the Rainbow Warrior while it was anchored in Auckland harbor, New Zealand.

France has said it will financially compensate the family of a Rainbow Warrior crew member killed in the bombing, Portuguese-born Dutch photographer Fernando Pereira.

Fabius laid the principal ''political'' blame on Hernu, whose close friendship with Mitterrand dates back 30 years. Hernu refused to comment on Fabius' statements, and there were press reports that relations between Fabius and Mitterrand had become decidedly cool.

The Rainbow Warrior had been preparing to lead a protest flotilla to the French nuclear testing site in the South Pacific.

At the United Nations on Thursday, Foreign Minister Ronald Dumas reiterated France's determination to continue its nuclear tests.

Mitterrand's Socialist government, while condemning the sinking and implying that Hernu and Lacoste acting out of a misguided sense of nationalism, has so far prosecuted only people accused of revealing the story to the media.