Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have been assigned a semester project to build a torrent site.I am unaware that how do i add the .torrent file in mysql database?Please reply ASAP
Posted
Comments
ZurdoDev 24-Nov-15 11:41am    
You can store the file in the database as blob/binary or you can store the file on the hard drive and then store the path to the file in the database.
Zujaj 24-Nov-15 11:51am    
Thanks RyanDev if i want to store the path, which datatype do you prefer varchar or TEXT?Another thing when i store the path ofthe file,will the torrent file be view in the database as xxx.torrent?
ZurdoDev 24-Nov-15 12:06pm    
Path can be varchar. I would store the whole path including drive and folders. This will require proper permissions. I would suggest you look for example of storing as binary in the db and as storing the path in the db because both have pros and cons and then decide what you want.
phil.o 24-Nov-15 12:29pm    
My virtual 5.
phil.o 24-Nov-15 12:31pm    
It's a little bit harsh from you to present us with your assignment and urge us to reply.

1 solution

As discussed in the comments, I suggest looking for examples of the two main different ways of doing this.

1. Store the file in binary format in the database directly. This keeps the image with the db but you'll need code to process it when you pull it out of the db.
2. Store the file on the server somewhere and then in the database only write out the path to the file.

Either way has pros and cons so after you find a couple of examples go with one that feels better for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900