Uploading and uploading a file using spring hibernation is little to be confused with the approach. Can someone direct me to the same thing ...?

I am creating one module in which I need to provide functionality for downloading and uploading any file through a browser.

I tried to find approaches to fulfill my requirements.

Database Server: Oracle 10 g framework: Spring and Hibernation Front: JSP

I now have two options

  • Import a file into oracle database (data type blob) and retrieve the same file using BufferedOutputStream

  • I will create a folder on the server to store all the files. The user will upload images there at this location. the database will have one column to store the absolute path to this file, which will be used when reading this file

For example, the user uploads imageABC.jpg, the application will upload this file (with the updated name unique_id.jpeg) to the directory D: \ DIS21 \ Storage \ in the database path column will be updated using D: \ DIS21 \ Storage \ unique_id.jpeg

while reading a file, the application will read the file along the path D: \ DIS21 \ Storage \

I got a little confused about the aspects of approach and security. can anyone guide me on the same .. ??

+3
source share
1 answer

Both approaches work. The drawback of option 1 is that it will add additional I / O pressure to the database, but this may not be a problem depending on the load on your system.

2 , , .. , , - . , -, .

, , ( ), .

+1

All Articles