It depends. In the EU, Facilitating Copyright Theft by providing links to material (even if you do not provide any files) is illegal - hence the piratebay fiasco. Get legal advice.
If you are aiming to make the next big warez site, please leave now and never come back.
On the other hand, if I.E. you just want to provide torrents of your own stuff, which you hold the rights to (i.e. some software you have developed), then go ahead. Torrents themselves arent illegal, its just that they may be used for such means. Many opensorurce projects, for example, distribute large files using torrents to save on bandwidth.
Take a normal web signup page, for example, right?
In that case, you would have a plain HTML form which POSTS some data (username, whatever) to some web code to handle the database interaction.
its the same. You just need to POST the expected fields from the phone to a web app (posting the image as a binary file is the difficult bit), and let the web server handle what to do with the data once it gets it (i.e. save image away somewhere, insert associated data into database)