Re: Struts 2 File upload to store the filedata

2011-01-27 Thread PrateekA
Even i was trying implementing the same think but i couldnt make it. I used image/jpeg inputStream filename="${filename}" 1024 But got an exception saying "Can not find a java.io.InputStream with the name [inputStream] in the invocation stac

Re: Struts 2 File upload to store the filedata

2009-06-10 Thread fireapple
Jeromy Evans - Blue Sky Minds wrote: > > > Hi Johnson, I think just need to read up a little more on Struts 2 as it > seems you're trying to do too much yourself based on Struts1 experiences > rather than let the framework do more of the routine work. Ian Roughly's > book is a good place to

RE: Struts 2 file upload

2009-02-10 Thread Martin Gainty
other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Tue, 10 Feb 2009 07:43:52 -0800 > From: pie...@hotmail.com > To: user@struts.apache.org > Subject: Re: Struts 2 file upload > >

Re: Struts 2 file upload

2009-02-10 Thread Lund
Lund wrote: > > > > newton.dave wrote: >> >> Lund wrote: >>> I'm using Strurs 2.1.2 and the tag >>> in >>> the jsp page. >>> My problem is that while the fileUpload appears to work most of the time >>> I >>> do get java.io.FileNotFoundException: on the .tmp file that Struts uses >>> as >>>

Re: Struts 2 file upload

2009-02-10 Thread Lund
newton.dave wrote: > > Lund wrote: >> I'm using Strurs 2.1.2 and the tag >> in >> the jsp page. >> My problem is that while the fileUpload appears to work most of the time >> I >> do get java.io.FileNotFoundException: on the .tmp file that Struts uses >> as >> part of the process (prob 1 in 1

Re: Struts 2 file upload

2009-02-09 Thread Dave Newton
Lund wrote: I'm using Strurs 2.1.2 and the tag in the jsp page. My problem is that while the fileUpload appears to work most of the time I do get java.io.FileNotFoundException: on the .tmp file that Struts uses as part of the process (prob 1 in 10 times). Once this happens of course the whole

Re: Struts 2 file upload size validation

2008-05-09 Thread Rubbinio
mgainty wrote: > > 2.0.11 FileUploadIntereptor.java > > ActionContext ac = invocation.getInvocationContext(); > HttpServletRequest request = (HttpServletRequest) > ac.get(ServletActionContext.HTTP_REQUEST); > HashMap map = request.getParameterMap(); > //for further information take a look at >

Re: Struts 2 file upload size validation

2008-05-08 Thread Rubbinio
Yes if the file size is OK everything is fine. At first we used the default stack. Then we took the default and modified it by moving the fileUploadInterceptor below the params interceptor so it would look something like this: interceptor-stack name="ourUploadStack" interceptor-ref name="ex

Re: Struts 2 file upload size validation

2008-05-07 Thread Laurie Harper
The OP wrote: >> we are trying to use file upload in Struts 2... Martin wrote: Struts 1.2.9 Doh! org.apache.struts.chain.servlet.validateActionForm where the validate method is declared as protected ActionErrors validate(Context context, ActionConfig actio

Re: Struts 2 file upload size validation

2008-05-07 Thread Laurie Harper
Rubbinio wrote: Hi, we are trying to use file upload in Struts 2 and run into the following problem. We have a form with multiple fields among which one is a file input field. The user must complete the form and then select a file to upload. If the file size is larger than what we specify in th

Re: Struts 2 file upload size validation

2008-05-07 Thread Martin
Struts 1.2.9 org.apache.struts.chain.servlet.validateActionForm where the validate method is declared as protected ActionErrors validate(Context context, ActionConfig actionConfig, ActionForm actionForm) //reference the actionF

Re: Struts 2 File upload to store the filedata

2007-12-07 Thread Jeromy Evans
Johnson nickel wrote: Hi Evans, I digged in google examples in StreamResult. But, i can't understand. I want to display the images in browser Using StremResult. Instead of ServletOutputStream out= response.getOutputStream(); How can i use StreamResult. Can u gi

Re: Struts 2 File upload to store the filedata

2007-12-07 Thread Martin Gainty
: "Johnson nickel" <[EMAIL PROTECTED]> To: Sent: Friday, December 07, 2007 8:39 AM Subject: Re: Struts 2 File upload to store the filedata > > > Hi Evans, > > I digged in google examples in StreamResult. But, i can't > understand. > I want to displ

Re: Struts 2 File upload to store the filedata

2007-12-07 Thread Johnson nickel
Hi Evans, I digged in google examples in StreamResult. But, i can't understand. I want to display the images in browser Using StremResult. Instead of ServletOutputStream out= response.getOutputStream(); How can i use StreamResult. Can u give some examples pgm??

Re: Struts 2 File upload to store the filedata

2007-12-07 Thread Jeromy Evans
Don't use ServletOutputStream within Struts2. Use a StreamResult instead: http://struts.apache.org/2.0.11/docs/stream-result.html In the example provided in the above link, inputName references a property in your action that's an InputStream you need to create from your data. InputStream ge

Re: Struts 2 File upload to store the filedata

2007-12-07 Thread Johnson nickel
Hi Evans, I want to display the images in browser from the database. I have added my code.It throws null pointer Exception. In my action, i have implements ServletRequestAware,ServletResponseAware interface. I want to know if ServletOutputStream

Re: Struts 2 File upload to store the filedata

2007-12-05 Thread Jeromy Evans
Johnson nickel wrote: Hi Jeromy Evans, Thanks for your reply. I would like to insert the images into my Databases. For that, i'm using byte[] array. In Struts 1.3, I used FormFile class. From this class i got the method getFileData();

Re: Struts 2 File upload to store the filedata

2007-12-05 Thread Johnson nickel
Hi Jeromy Evans, Thanks for your reply. I would like to insert the images into my Databases. For that, i'm using byte[] array. In Struts 1.3, I used FormFile class. From this class i got the method getFileData(); In my db, ps.setBytes(1,fi

Re: Struts 2 File upload to store the filedata

2007-12-05 Thread Jeromy Evans
Johnson nickel wrote: Hi everyone, I am using Struts 2 and using tag to upload a file. But I get that file as a 'File' object in my action class and using getFileName() on that File object returns me some arbitrary value (something like upload__5b41f107_1127b4befe0__8000_.tmp). I want t