简体   繁体   中英

Uploading file using java

Dear All, I am developing an automative tool.for this I need file attachement functionality.Back end using Mysql 5.2,Appache tomcate server.Can any body suggest me uploading file to DB is better OR uploading it to server is better. Thanks in advance.

Read this post for which is best .Meanwhile may i know what kind of file(image,movie,text doc) , what is it's file size?

File paths in the DB is definitely the way to go

Storing Images in DB - Yea or Nay?

HighLights:

  • Database is for a structured data.
  • Long Run performance hit and backup .
  • Small static images (not more than a couple of megs) that are not frequently edited, should be stored in the database. This method has several benefits including easier portability (images are transferred with the database), easier backup/restore (images are backed up with the database) and better scalability (a file system folder with thousands of little thumbnail files sounds like a scalability nightmare to me).

File store. Facebook engineers had a great talk about it. One take away was to know the practical limit of files in a directory.

Needle in a Haystack: Efficient Storage of Billions of Photos

DBMS has following advantages

  • You can access it from multiple site, if you store in FS you need some protocol to transfer it

  • With DBMS you will have relation things directly while for FS you need to manage it programatically

  • With DBMS you can have advantage of ORM.

My vote goes to DBMS

将文件上传到服务器并在数据库中输入其路径条目是一种更好的方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM