This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes Efficient way of uploading a media file [img] to server using jsp view Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Efficient way of uploading a media file [img] to server using jsp view" Watch "Efficient way of uploading a media file [img] to server using jsp view" New topic
Author

Efficient way of uploading a media file [img] to server using jsp view

Vivek K Jain
Greenhorn

Joined: Mar 17, 2013
Posts: 19

i have heard storing images to database as BLOB is ridiculously slow and inefficient way of doing the uploading and retrieving task.
so the FileUpload method described in FAQs is a better option?right?
Can i find a better code/method than this.[i will eliminate those dirty scriptlets :)]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Regardless of whether you end up storing the file in a DB or in the file system, the upload process is pretty much the same.

And yes, a servlet should be used for the Java code, not a JSP.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vivek K Jain
Greenhorn

Joined: Mar 17, 2013
Posts: 19

sir i have understood the method explained in the FAQs and i am using fileupload method
below is the code:


now what i want is to store the path info to my database field so that later i can reference my db to retrieve the image from server ..how can i accomplish that?
please provide code snippets.
p.s. the above code is copied from a site and obviously looks ugly with all the scriptlet code.. i have improved it .
 
Consider Paul's rocket mass heater.
 
subject: Efficient way of uploading a media file [img] to server using jsp view
 
Similar Threads
Notifiying EJB when database table changes
in jsp i want touse java script variable value
how can i get a value in java script function from database
This Weeks GiveAway:
Request dispatcher doesn't redirect to the jsp page