A method of preparing a porous film comprises (1) electrodepositing material from a mixture onto a substrate to form a film using a mixture comprising (a) a source of metal, inorganic oxide, non-oxide semiconductor/conductor, organic polymer or a mixture; (b) a solvent; and (c) sufficient of a structure-directing agent to form a homogeneous lyotropic liquid crystalline (LC) phase in the mixture; and (2) optionally, removing the structure-directing agent. Also claimed is a porous film with a regular structure and a uniform pore size electrodeposited onto a substrate.    USE -   Used in an electrochemical devices and sensors, e.g. in gas sensors for carbon monoxide, methane or hydrogen sulfide or in "electronic nose" applications; in chemical sensors, e.g. for process control in the chemicals industry; in biosensors, e.g. for glucose or therapeutic drugs; in energy storage cells and batteries, e.g. as electrodes and solid electrolytes; in solar cells, e.g. as collectors or supports for organometallic species; in electrochromic devices, e.g. display devices or "smart" windows as electrodes or solid electrolytes or electroactive components; in field emitters, e.g. display devices or electronic devices; as nanoelectrodes, e.g. for electrochemical studies; in electrocatalysis, e.g. in enzyme mimicry or "clean synthesis" of pharmaceuticals; in magnetic devices, e.g. magnetic recording media or giant magnetoresistive media; in optical devices, e.g. non-linear optical media, evanescent wave devices, surface plasmon polaritron devices or optical recording media; in surface-enhanched optical processors; carrying out chemical reactions or physical processes in confined geometries; for chemical separations, e.g. in gas separation, electrostatic precipitators, electrochemical separators or electrophoresis; and in devices for the controlled delivery of therapeutic agents. Also as a template for the (electro)chemical production of other porous films or powders, e.g. by filling or coating the pores with an (in)organic material then removal of the film by (electro)chemical dissolution, optionally with chemical or physical treatment of the filled or coated film to modify its chemical composition before the film is removed.    ADVANTAGE -   The nanostructure of the film may be controlled precisely by the choice of the LC phase, e.g. a cubic LC phase will produce cubic pores in the film. The thickness, surface area and capacitance of the deposited film may all be controlled. Well-defined porous films may be prepared with a regular distribution of uniformly sized pores.