pranshu82202 Posted July 30, 2011 Share Posted July 30, 2011 Well i want to store an image file (Or any other like zip etc.) of around 2 MB (or even more) in my mysql database, what should be the column properties for that.... Lonblob is even unsuccessful for this... Please help.... Quote Link to comment https://forums.phpfreaks.com/topic/243260-large-size/ Share on other sites More sharing options...
gizmola Posted July 30, 2011 Share Posted July 30, 2011 Longblob is the right data type for doing this with mysql. Typically storing files inside the db is not the best solution in a web application, due to the overhead of having to receive the data and then pump it into the db via the client, as well as the fact that an rdbms offers very little functionality of any use on large blobs of data. People traditionally just store files on an nfs mounted filesystem for medium to large systems, or lately, have been using nosql solutions that are built for for storing files, and have the advantage of instrinsic distribution and scalability like mongodb's gridfs (see Tom's great intro to the topic http://www.phpfreaks.com/tutorial/an-introduction-to-php-and-mongodb) or membase: http://docs.couchbase.org/membase-getting-started-1.7/index.html Quote Link to comment https://forums.phpfreaks.com/topic/243260-large-size/#findComment-1249355 Share on other sites More sharing options...
pranshu82202 Posted July 30, 2011 Author Share Posted July 30, 2011 Admin i didnt get you... I think you are saying That i shuld upload file anywhere and in my database i shuld keep the url only.... But where i shuld upload my file??? Quote Link to comment https://forums.phpfreaks.com/topic/243260-large-size/#findComment-1249366 Share on other sites More sharing options...
gizmola Posted July 30, 2011 Share Posted July 30, 2011 Yes, that is what I am suggesting. Store a url and put the file on the filesystem or in one of the nosql systems I suggested. You can just store files on the filesystem of the server, but this might be a problem if your site ever needs to scale beyond a single server. Quote Link to comment https://forums.phpfreaks.com/topic/243260-large-size/#findComment-1249368 Share on other sites More sharing options...
bartalen Posted July 30, 2011 Share Posted July 30, 2011 Here's a help into the file upload and als use the database to save your file info... http://www.php-mysql-tutorial.com/wikis/php-tutorial/uploading-files-to-the-server-using-php.aspx Quote Link to comment https://forums.phpfreaks.com/topic/243260-large-size/#findComment-1249394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.