Sql Server 2012 store pdf [closed]

為{幸葍}努か 提交于 2020-01-11 09:38:29

问题


How to store PDFs file in database and how to show preview using the asp.net. the PDFs file is uploaded by control and then i need to show preview afterward i store into the database.

    <input type="file" />

回答1:


Generally, you can choose one of the following techniques:

  • Upload the file in specific folder in your server and store in your database only the URL to the file. Latter, use the URL for showing or downloading the file
  • Upload the file and store in the database in BLOB (Binary Large OBject) field

Each of these, has advantages and disadvantages and it is up to your situation and you to decided which technique for use.

Fortunately, when we are using SQL Server for storing files we have one more option which can lead to better performance - Filestream Storage.

This type of storage is recommended in the following situations:

  • Objects that are being stored are, on average, larger than 1 MB.
  • Fast read access is important.
  • You are developing applications that use a middle tier for application logic

Since, rarely PDF files are smaller then 1 MB, I believe you should use this technique but:

For smaller objects, storing varbinary(max) BLOBs in the database often provides better streaming performance.

You can check the following this tutorial in order to activate the storage.



来源:https://stackoverflow.com/questions/20591906/sql-server-2012-store-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!