Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating thumbnail for uploaded files

 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all... I am working on a file sharing project .. Here users can upload / download files .. As in some file sharing sites i have seen when an user uploads a file (say an image file ) , he can view the thumbnail view of that file(image or video , whatever..) in his account.. So i want to achieve this..

the following is the jsp page where the user can upload a file by clicking on button..




The Upload file servlet code is shown below--->>



after doing this the file gets uploaded to the users account ( on the disc and the file path and file name is saved in database)... Now what i want to achieve is a thumbnail image to get created as soon as the file is uploaded and when the user opens his account , he views the thumbnail image of that file.. Please help me with detailed explainations and codes..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll ned to write some code to resize the image to create the thumbnail.

That has nothing whatsoever to do with JSP, so this post has moved to a more appropriate location.
 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You'll ned to write some code to resize the image to create the thumbnail.

That has nothing whatsoever to do with JSP, so this post has moved to a more appropriate location.


So where do i need to write those code ??
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your Upload servlet, put some code that will resize an image and save it in another file. In your JSP, provide a link to the resized image
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J Das wrote:
Bear Bibeault wrote:You'll ned to write some code to resize the image to create the thumbnail.

That has nothing whatsoever to do with JSP, so this post has moved to a more appropriate location.


So where do i need to write those code ??

Code never goes in a JSP. Never. Ever.

Ever.
 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
J Das wrote:
Bear Bibeault wrote:You'll ned to write some code to resize the image to create the thumbnail.

That has nothing whatsoever to do with JSP, so this post has moved to a more appropriate location.


So where do i need to write those code ??

Code never goes in a JSP. Never. Ever.

Ever.



So while uploading the file ( say an image file )from the jsp page , when i pass it to a servlet , is that the servlet where that code will appear ?? Please ignore my dumbness if it is so..
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[UD: Content removed. Let's continue the discussion of your question in the topic you started: http://www.coderanch.com/t/592069/open-source/video-Thumbnails-video-sharing-site ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic