As this storage of files belonging to the companies is something that helps the companies to do their work, because these files undoubtedly contain everything that they need of contracts, accounts, documents and other things that are essential to their business;
And as these companies include insurance companies and riba-based banks, your work in storing these files is regarded as cooperating with the insurance companies and riba-based banks in their haraam work. Allah, may He be exalted, says (interpretation of the meaning): “Help you one another in Al‑Birr and At‑Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression. And fear Allaah. Verily, Allaah is Severe in punishment”[al-Maa’idah 5:2].
What the Muslim must do is give up disobeying Allah, may He be exalted, and not help the sinner in his sin. You stated that you only know a few of the clients. Based on that, you cannot avoid falling into haraam (which is helping the insurance companies and riba-based banks) except by leaving this job, because it is a mixture of halaal and haraam work, and you are certain that you are inevitably falling into haraam.
If a person gives up something for the sake of Allah, Allah will compensate him with something better than it.
We will quote to you some of the fatwas of the scholars that have to do with your issue, so that you will understand that the least cooperation with these riba-based organisations comes under the heading of cooperating or helping in sin and transgression, which is something that Allah, may He be exalted, has forbidden to His believing slaves.
The Standing Committee for Issuing Fatwas was asked about a person who works as a guard in a bank.
They replied: It is not permissible for a Muslim to work as a guard in banks that deal with riba, because this comes under the heading of co-operating in sin and transgression, which Allah has forbidden as He says (interpretation of the meaning): “but do not help one another in sin and transgression” [al-Maa’idah 5:2]. And most of the banks deal with riba. End quote.
Fataawa al-Lajnah ad-Daa’imah, 15/43
The Standing Committee for Issuing Fatwas was also asked:
I work as a typist and sometimes I am asked to type letters to some banks to carry out some transactions, including cases where the company lends the bank (or borrows from it) a sum of money with a commission of such and such a percentage of the value of the loan. I hope that you can advise me as to how Islamically acceptable this work is with regard to writing these letters.
They replied: Your work recording riba-based transactions is haraam and the money that you receive in return for that is also haraam. It is narrated in a saheeh report that the Prophet (blessings and peace of Allah be upon him) cursed the one who consumes riba, the one who pays it, the one who writes it down and the two who witness it. What you must do is give up this job, because in that which is halaal there is sufficient so that one has no need of that which is haraam. If a person gives up something for the sake of Allah, Allah will compensate him with something better than it. End quote.
Fataawa al-Lajnah ad-Daa’imah, 15/60
The committee was also asked:
I work for Aramco in the housing department. This department gives loans to build accommodation for the workers. These loans are riba-based according to a fatwa from you. My work in this department has to do with allocation of land and I have nothing to do with signing loans, witnessing them and so on. Is there any sin on me because of my work in this department which gives riba-based loans?
If the situation is as you describe, that your work is in allocating land and not in giving riba-based loans, then your work does not have anything to do with riba directly, but it involves working with those who do deal with riba directly, and that is not permissible, because it comes under the heading of co-operating in sin and transgression. End quote.
Fataawa al-Lajnah ad-Daa’imah, 15/17-18
The following question was also sent to the committee:
I work as an accountant in a newspaper. This newspaper publishes a page every day that gives news about actors and entertainers, both male and female. Is there anything wrong with my salary?
Most of the news about actors and entertainers, both male and female, speaks of their evil and deviant ways. It also promotes idle pursuits and spreads temptation and promotes evil and corruption and other things that are abhorrent and take away dignity and moral values. Undoubtedly working in such fields is not permissible because it involves co-operating in sin and transgression. Based on that, it is not permissible to take this as a means of earning a living. There are many ways of earning a living, so one should fear one’s Lord. Allah, may He be exalted, says (interpretation of the meaning):
“And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty).
3. And He will provide him from (sources) he never could imagine”
“And whosoever puts his trust in Allaah, then He will suffice him. Verily, Allaah will accomplish his purpose. Indeed Allaah has set a measure for all things”
Fataawa al-Lajnah ad-Daa’imah, 15/52-53
Shaykh Saalih al-Fawzaan (may Allah preserve him) said:
Dealing with riba is haraam for companies, banks and individuals. It is not permissible for the Muslim to take a job in places that deal with riba, even if their dealing with it is minimal, because the one who works in these organisations and places that deal with riba will be cooperating with them in sin and transgression, and co-operating with those who deal in riba is also subject to the curse, because the Prophet (blessings and peace of Allah be upon him) said: “Allah has cursed the one who consumes riba, the one who pays it, the two who witness it and the one who writes it down.” End quote.
Al-Muntaqa min Fataawa al-Fawzaan, 68/8
And Allah knows best.
For more information please see the answer to question no. 82886.