Re: Uploading then displaying Images

2012-07-19 Thread ICE Ernesto Arteaga Zavala
:) Thanks! 2012/7/19 Thiago H de Paula Figueiredo > On Thu, 19 Jul 2012 11:50:57 -0300, arterzatij > wrote: > > Hi Thiago, how do you get the file from db? >> I mean the BLOB type of data base to a Java Type? >> > > Yep, probably to a byte array. > > -- > Thiago H. de Paula Figueiredo > > > --

Re: Uploading then displaying Images

2012-07-19 Thread Thiago H de Paula Figueiredo
On Thu, 19 Jul 2012 11:50:57 -0300, arterzatij wrote: Hi Thiago, how do you get the file from db? I mean the BLOB type of data base to a Java Type? Yep, probably to a byte array. -- Thiago H. de Paula Figueiredo - To unsu

Re: Uploading then displaying Images

2012-07-19 Thread arterzatij
Hi Thiago, how do you get the file from db? I mean the BLOB type of data base to a Java Type? Thanks in advance! -- View this message in context: http://tapestry.1045711.n5.nabble.com/Uploading-then-displaying-Images-tp3423946p5714604.html Sent from the Tapestry - User mailing list archive at

Re: Uploading then displaying Images

2011-08-08 Thread Josh Canfield
Ah, good to hear! On Mon, Aug 8, 2011 at 5:52 AM, David Canteros wrote: > Hi again Josh, i had not  seen your first response, there was the solution to > my problem. > Thank you! > David > > > > -- > David Germán Canteros > > > 2011/

Re: Uploading then displaying Images

2011-08-08 Thread David Canteros
Hi again Josh, i had not seen your first response, there was the solution to my problem. Thank you! David -- David Germán Canteros 2011/8/6 David Canteros > Yes, user is an object loaded in the setupRender() method, and getImag

Re: Uploading then displaying Images

2011-08-06 Thread David Canteros
Yes, user is an object loaded in the setupRender() method, and getImage() returns an InputStream every time the page is loaded. -- David Germán Canteros 2011/8/5 Josh Canfield > The real issue is more likely the first point, you'

Re: Uploading then displaying Images

2011-08-05 Thread Josh Canfield
The real issue is more likely the first point, you're getting your InputStream from an object from the session. Does calling getImage() return a new InputStream every time? On Fri, Aug 5, 2011 at 2:44 PM, David Canteros wrote: > Hi Josh; >           I have already tried with PageRenderLinkSource

Re: Uploading then displaying Images

2011-08-05 Thread David Canteros
Hi Josh; I have already tried with PageRenderLinkSource but It has the same behavior. I did not know the difference between LinkSource and PageRenderLinkSource, thanks for the information! David -- David Germán Canteros

Re: Uploading then displaying Images

2011-08-05 Thread Josh Canfield
Also. >    private LinkSource linkSource; This is an internal class, you should be using PageRenderLinkSource. You can replace: > linkSource.createPageRenderLink(DisplayImagePage.class.getSimpleName(), > false, new Object[]{imageId}); with pageRenderLinkSource.createPageRenderLinkWithContext(D

Re: Uploading then displaying Images

2011-08-05 Thread Josh Canfield
>            public InputStream *getStream*() throws IOException { >                User user = > (User)_request.getSession(true).getAttribute("user"); >                return user.getImage(); >            } It looks like you're pulling the User object from the session and then getting the InputSt

Re: Uploading then displaying Images

2011-08-05 Thread David Canteros
Hi I have to show a image loaded from database BLOB field. I implemented Thiago's suggestion, I have created a page with the following code: public class ShowImagePage { @Inject private LinkSource linkSource; (...) public Link *getUploadedFile*(String imageId) { retu

Re: Uploading then displaying Images

2011-03-11 Thread Rich M
Thanks everyone for the responses so far, conceptually I think this is coming together for me. So, I'm glad the context path was not a good idea, it felt dirty from the beginning. Avoiding that, there are two main options: use the database to store/retrieve the images, or use a configured syst

Re: Uploading then displaying Images

2011-03-11 Thread Thiago H. de Paula Figueiredo
On Fri, 11 Mar 2011 09:24:35 -0300, LLTYK wrote: Nobody's mentioned createEventLink. That's where you get the image url, create an event link pointing to the event handler that returns the stream response. I haven't mentioned it because my preferred approach is to create a page just for r

Re: Uploading then displaying Images

2011-03-11 Thread LLTYK
Nobody's mentioned createEventLink. That's where you get the image url, create an event link pointing to the event handler that returns the stream response. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Uploading-then-displaying-Images-tp6159049p6161239.html

Re: Uploading then displaying Images

2011-03-10 Thread Kalle Korhonen
On Thu, Mar 10, 2011 at 5:02 PM, Josh Canfield wrote: >> Sorry, but that's a really bad advice - never put uploaded files under >> the context path of your application. What happens when you update the >> WAR? > Strongly agree. >>                return new >> BufferedImageStreamResponse(ImageIO.r

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 22:02:04 -0300, Josh Canfield wrote: Sorry, but that's a really bad advice - never put uploaded files under the context path of your application. What happens when you update the WAR? Strongly agree. I agree too. I put my uploaded files in the database. I was just tryi

Re: Uploading then displaying Images

2011-03-10 Thread Josh Canfield
> Sorry, but that's a really bad advice - never put uploaded files under > the context path of your application. What happens when you update the > WAR? Strongly agree. >                return new > BufferedImageStreamResponse(ImageIO.read(imageStorage.getImageInputStream(imageId))); What is th

Re: Uploading then displaying Images

2011-03-10 Thread Kalle Korhonen
On Thu, Mar 10, 2011 at 4:11 PM, Thiago H. de Paula Figueiredo wrote: > On Thu, 10 Mar 2011 19:24:52 -0300, Rich M wrote: >> Primarily because I can't think of a reasonable way to build a URL to the > I think you have a confusion here. The folder structure you use while > developer doesn't matter

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 19:24:52 -0300, Rich M wrote: Primarily because I can't think of a reasonable way to build a URL to the file that could actually be served. I wish I was more knowledgeable about servlets and such, but if my application is running from a WAR, how would I get any files in

Re: Uploading then displaying Images

2011-03-10 Thread Josh Canfield
I think this thread has gotten me very confused. You have uploaded files, presumably you know where they are and can identify them. You want to get those files to display in your browser. In order to do that you create an tag that contains a URL as the value of the src attribute that points to yo

Re: Uploading then displaying Images

2011-03-10 Thread Rich M
On 03/10/2011 04:21 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 10 Mar 2011 17:49:14 -0300, Rich M wrote: Okay, that makes sense. Is there a way to use the StreamResponse instead of the URL then to display an image in the browser? Unless you want to generate one of that data URLs (http

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 17:49:14 -0300, Rich M wrote: Okay, that makes sense. Is there a way to use the StreamResponse instead of the URL then to display an image in the browser? Unless you want to generate one of that data URLs (http://en.wikipedia.org/wiki/Data_URI_scheme), you'll need to ge

Re: Uploading then displaying Images

2011-03-10 Thread Rich M
On 03/10/2011 03:17 PM, Thiago H. de Paula Figueiredo wrote: On Thu, 10 Mar 2011 16:37:29 -0300, Rich M wrote: Hi, Hi! I had read this thread http://tapestry.1045711.n5.nabble.com/How-to-display-Blob-byte-array-image-td2436148.html along with other information regarding uploading/displayi

Re: Uploading then displaying Images

2011-03-10 Thread Thiago H. de Paula Figueiredo
On Thu, 10 Mar 2011 16:37:29 -0300, Rich M wrote: Hi, Hi! I had read this thread http://tapestry.1045711.n5.nabble.com/How-to-display-Blob-byte-array-image-td2436148.html along with other information regarding uploading/displaying images. I think I'm a bit confused as to what my ImageS

Uploading then displaying Images

2011-03-10 Thread Rich M
Hi, I think I've run into a conceptual understanding roadblock in trying to setup uploading then displaying of images in my application. I've got the uploading part working so far, although since my application is deployed as a WAR, the files upload to a system folder. That works alright, bu