We propose a new integrated device for spintronics application, which is based on a hybrid metal-semiconductor structure. The device consists of a Si-based p-i-n photodetector sandwiched between two layers of a ferromagnetic metal (3d ferromagnet or half-metallic compound). The photocurrent flowing in such a system is shown to depend on its magnetic configuration. This, in turn, allows controlling the device performance by an externally applied magnetic field. We have estimated magnitude of the effect and also determined the role of relevant material parameters.