Mapping of the magnetic flux distribution in a square-shaped superconducting YBa2Cu3O7 thin film was carried out using a scanning micro-Hall probe with a spatial resolution of about 25 μm. Calculation procedures for converting the measured flux map to the film current distribution are discussed. The flux penetration with the applied field perpendicular to the film surface was studied in initially zero-field-cooled samples. With full flux penetration, the film sheet currents follow the sample edges, whereas with partial flux penetration, the sheet currents are more complex and include multiply connected patterns. In both cases the sheet currents change their flow direction abruptly along the sample diagonals where the shielding is more effective, and this results in distinctive minima of the flux penetration. The saturation magnetization for a square-shaped sample of side 2a was found to be identical to that for disc and cylindrical samples of radius a. It is shown that the multiply connected current patterns corresponding to various parts of the hysteresis cycle can be reconstructed from the superposition of two appropriate virgin current distributions. The critical current density was dependent on magnetic flux density, and it was found to follow the Kim model.