= upload;
>> }
>>
>> public void setFiletoUploadContentType(String uploadContentType[]) {
>> this.fileToUploadContentType = uploadContentType;
>> }
>>
>> public void setFiletoUploadFileName(String uploadFileName[]) {
>> this.fileToUploadFileName
id setFiletoUploadFileName(String uploadFileName[]) {
> this.fileToUploadFileName = uploadFileName;
> }
>
> 2011/10/28 Sekar, Sowmya
>
> Hi,
>> Does anyone have a working solution of multiple formfile uploads? I
>> declared the formfile as an arraylist and
, Sowmya
> Hi,
> Does anyone have a working solution of multiple formfile uploads? I
> declared the formfile as an arraylist and indexed the property in the jsp
> files. I also changed the setter and getter methods to take the index and
> formfile object. However, when I save the
Hi,
Does anyone have a working solution of multiple formfile uploads? I declared
the formfile as an arraylist and indexed the property in the jsp files. I also
changed the setter and getter methods to take the index and formfile object.
However, when I save the form, it throws "argument
Could you filter on the extension of the file name instead?
Nils-H
On Tue, Jan 27, 2009 at 6:28 PM, Tatiyana Tarabara wrote:
> Hi,
> I am facing some problems while uploading a file using Struts' FormFile
> object. I want to allow user to upload only .pdf files. For that I am
&
Hi,
I am facing some problems while uploading a file using Struts' FormFile
object. I want to allow user to upload only .pdf files. For that I am
comparing the ContentType of the file being uploaded using FormFile's
getContentType() method.
The problem is , when users uploading their
, why copy it again, especially if it's big - it just adds another step.
-Original Message-
From: Dave Newton [mailto:newton.d...@yahoo.com]
Sent: Wednesday, December 17, 2008 12:52 PM
To: Struts Users Mailing List
Subject: RE: get file path from FormFile
It hardly seems necessary
It hardly seems necessary to make a framework change when you can just write
the file.
--- On Wed, 12/17/08, Givler, Eric wrote:
> From: Givler, Eric
> Subject: RE: get file path from FormFile
> To: "'Struts Users Mailing List'"
> Date: Wednesday, December
Would there be an issue with modifying the controller settings and setting the
memFileSize artifically low so the file is always written to disk, then gaining
access to the filename via reflection?
// create in package org.apache.struts.upload
public static String getFilePath( FormFile file
--- On Wed, 12/17/08, elyes sallem wrote:
> String mimetype = context.getMimeType(filePath.replaceAll("/", "//"));
You shouldn't need to do that.
Dave
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional
be coool ...,
in fact i didn't that before download or upload
it is new dev , that is why ...(all we begin by this step, it was the case
for you i suppose...),
furtheremore, i resolved it => (so don't think that i'm waiting response
...)
those who are interested , here is the code i added at the b
elyes sallem wrote:
it forwarded me to page with "unreadable data"
comapred to the first example, you omit the
resp.setHeader("Content-Disposition", ...
Sorry if this sounds a bit harsh, but the people on this list are not
here to solve any single Java or Servlet-API related mystery for you
it forwarded me to page with "unreadable data"
comapred to the first example, you omit the
resp.setHeader("Content-Disposition", ...
here is the code ,i have the export method in a dispatch action :
public ActionForward exportSelectedIntaff(ActionMapping mapping,
ActionForm form, H
Hi Elyes,
something like this here should work:
OutputStream out = resp.getOutputStream();
FileInputStream fileStream = new
FileInputStream("path/to/your/excelFile.xls");
int bufferLen = 1024 * 8;// 8 KB
byte[] buffer = new byte[bufferLen];
while (tru
o avoid any confusion,
> > all i want to do is that :
> > 1- i have data in a file, so through the formfile, i get the file path
> (now
> > i make the test locally, but after it will be deployed on a server) and i
> > load this data in a database, depending on the file'
Hello Robert ,
so assume that i have an excel file on the server
and i have a button to download it for the client (of course with a browse
dialog)
could you show me how develop it , in your example , you call
writePDFDataToOutputStream
and it is a pdf file which is not my case
Thanks
Regards
Ely
provided to you in your previous thread:
Stream the file content to the browser.
If 3) See 1) and 2)
Nils-H
On Tue, Dec 16, 2008 at 2:09 PM, elyes sallem wrote:
> to avoid any confusion,
> all i want to do is that :
> 1- i have data in a file, so through the formfile, i get the file path
--- On Tue, 12/16/08, elyes sallem wrote:
> to avoid any confusion,
Too late!
> 1- i have data in a file, so through the formfile, i get
> the file path (now i make the test locally, but after it
> will be deployed on a server) and i load this data in a
> database, depending on
to avoid any confusion,
all i want to do is that :
1- i have data in a file, so through the formfile, i get the file path (now
i make the test locally, but after it will be deployed on a server) and i
load this data in a database, depending on the file's meta data, and its
content
2- i allo
t;> after this (so as a constraint, i can't modify the class in
>> this jar)
>
> So... you're *uploading* a file to the server (from the user of the browser
> to the web application)??? Then you need to save the FormFile locally and use
> *t
ile to the server (from the user of the browser to
the web application)??? Then you need to save the FormFile locally and use
*that* path when you call your library methods.
Dave
-
To unsubscribe, e-mail: user-unsubscr...@strut
e user.
>
> Nils-H
>
> On Tue, Dec 16, 2008 at 12:24 PM, elyes sallem
> wrote:
> > Hello,
> > after publishing this question, i conclude that it is not possible de get
> > back the absolute path from FormFile
> > but the problem is that i import a jar file, in
ou get
*EXACTLY* the behavior you desire. No applet. No fumbling around with
FormFile properties. No file upload.
Robert
elyes sallem wrote:
Hello,
after publishing this question, i conclude that it is not possible de get
back the absolute path from FormFile
but the problem is that i import a j
--- On Tue, 12/16/08, elyes sallem wrote:
> after publishing this question, i conclude that it is not
> possible de get back the absolute path from FormFile but
> the problem is that i import a jar file, in which i call
> a method that accept only path of file so what do you propo
be downloaded by the user.
Nils-H
On Tue, Dec 16, 2008 at 12:24 PM, elyes sallem wrote:
> Hello,
> after publishing this question, i conclude that it is not possible de get
> back the absolute path from FormFile
> but the problem is that i import a jar file, in which i call a
Hello,
after publishing this question, i conclude that it is not possible de get
back the absolute path from FormFile
but the problem is that i import a jar file, in which i call a method that
accept only path of file
so what do you propose, i get the inputstream , then i create temporarly a
file
I think, you need to put a hiperlink or a button for start your action. Then
you need to retrieve the data from the db, generate the csv Stream or File
as you wish to call it. Then the only diference between a Servlet.doGet
method an Action.execute method is 2 parameters ActionMapping and
ActionFor
--- On Mon, 12/15/08, elyes sallem wrote:
> do you have an other solution? the html:file doesn't
> work for saving a new file
Stream the result (a servlet example was given, it's the same for an action-you
just return null instead of an ActionForward). The *BROWSER* opens a "save as"
dialog box.
2008/12/15 Dave Newton
> *boggled*
>
> --- On Mon, 12/15/08, elyes sallem wrote:
> > i used a filechooser class (swing), if any one have an
> > others solution, i'm interested here is the code :
> >
> > String wd = System.getProperty("user.dir");
> > JFileChooser fc = new JFileChooser(wd);
> >
*boggled*
--- On Mon, 12/15/08, elyes sallem wrote:
> i used a filechooser class (swing), if any one have an
> others solution, i'm interested here is the code :
>
> String wd = System.getProperty("user.dir");
> JFileChooser fc = new JFileChooser(wd);
> int rc = fc.showDialog(null, "Select Data
i used a filechooser class (swing), if any one have an others solution, i'm
interested
here is the code :
String wd = System.getProperty("user.dir");
JFileChooser fc = new JFileChooser(wd);
int rc = fc.showDialog(null, "Select Data File");
if (rc == JFileChooser.APPROVE_OPTION)
{
File file = fc.g
in fact, i will not do it in a servlet, but in an action (execute method)
Regards
Elyes
2008/12/15 Robert Graf-Waczenski
> Here's an example:
>
> public class Downloader extends HttpServlet
> {
> private void doGet(HttpServletRequest req, HttpServletResponse resp) throws
> IOException
> {
>
Here's an example:
public class Downloader extends HttpServlet
{
private void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Cache-control", "no-cache");
resp.setIntHeader("Expires", -1);
path*
>>>>
>>>>
>>> Oh, I thought you said "[...] struts tag to export file [...]"
>>>
>>>
>>>
>>>> --- On Mon, 12/15/08, elyes sallem wrote:
>>>>>
>>>>>
>>>>>> all i want, is what i
ok, do you have an example?
Thanks
Regards
Elyes
2008/12/15 Dave Newton
> --- On Mon, 12/15/08, elyes sallem wrote:
> > the problem is that with the html:file you must browse to an
> > existant file, but in my case, i wanna browse to a new file,
> > and then in the action i will make some trea
--- On Mon, 12/15/08, elyes sallem wrote:
all i want, is what is the struts tag to export file [...]
FormFile has a getFileName() method. Different browsers submit different
values for this: some send the entire path, some just send the file name.
Is that also not wha
thought you said "[...] struts tag to export file [...]"
>>
>> >> --- On Mon, 12/15/08, elyes sallem wrote:
>> >>> all i want, is what is the struts tag to export file [...]
>>
>> FormFile has a getFileName() method. Different browsers submit d
--- On Mon, 12/15/08, elyes sallem wrote:
> the problem is that with the html:file you must browse to an
> existant file, but in my case, i wanna browse to a new file,
> and then in the action i will make some treatment, generate
> data and export them to this file
That's not how you do that.
Y
gt; it is not to export the file content , i want juste get back in the
> > action, the *selected file path*
>
> Oh, I thought you said "[...] struts tag to export file [...]"
>
> >> --- On Mon, 12/15/08, elyes sallem wrote:
> >>> all i want, is what is
l i want, is what is the struts tag to export file [...]
FormFile has a getFileName() method. Different browsers submit different values
for this: some send the entire path, some just send the file name.
Is that also not what you're asking?
Dave
There is no reliable way to get the selected file path. This has been
discussed a few days ago on this list.
Robert
elyes sallem wrote:
it is not to export the file content
, i want juste get back in the action, the *selected file path*
2008/12/15 Dave Newton
--- On Mon, 12/15/08, elyes
it is not to export the file content
, i want juste get back in the action, the *selected file path*
2008/12/15 Dave Newton
> --- On Mon, 12/15/08, elyes sallem wrote:
> > all i want, is what is the struts tag to export file [...]
>
> There is no tag to export a file.
>
> Dave
>
>
>
--- On Mon, 12/15/08, elyes sallem wrote:
> all i want, is what is the struts tag to export file [...]
There is no tag to export a file.
Dave
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands,
Regards
Elyes
-- Forwarded message --
From: elyes sallem
Date: 2008/12/15
Subject: export file data using formFile
To: Struts Users Mailing List
Hello,
i want to use a formfile in jsp page, where once i browse to file , i want
to laucnh directly the action, export data to this file
(without
Hello,
i want to use a formfile in jsp page, where once i browse to file , i want
to laucnh directly the action, export data to this file
(without a submit button near the fromfile)
how can i make it?
Regards
Elyes.
tring(bean,field.getProperty());
However, how do i get the value for a FormFile field? I would like to
get the value as a FormFile object.
FormFile myFile = (FormFile) // TODO
Next i post the involved file's snippets.
# struts-config.xml
http://jakarta.apache.org/struts/dtds/struts
Hello,
I am currently using Struts 1 - FormFile to uplaod various documents. Now I
have a requirement to read an excel file as the user uploads it. For this I
am using Apache POI.
this is how poi reads an excel sheet
InputStream myxls = new FileInputStream("workbook.xls"));
HSSFW
Storing the FormFile reference into the request wont help; request
attributes are discarded at the end of request processing, so by the
time the next page submits the first request has gone away. To keep
something from one request available to the next request, you would have
to put it into
Wait a moment, maybe I misunderstood.
You are writing about "pages", but do they stay in the same HTTP request?
If yes, ok, the FormFile is available through the whole request, but it can
be read only once (IIRC).
Antonio
Yes, I thought I mentioned that I could parse it and store it until
I need it.
However, I don't like to store data like that in a session ... it could
be a lot of data.
But I could pass it into the request
Antonio Petrelli wrote:
2008/3/27, Tom Holmes Jr. <[EMAIL PROTECTED]>:
Wel
2008/3/27, Tom Holmes Jr. <[EMAIL PROTECTED]>:
>
> Well, my use case, I am parsing a CSV file and the first line contains
> the header information.
> Each column has a header so rather than parse the entire file at
> this time, I just grab the first line.
> That's all I need to do in that acti
o, I still need to hold onto this file until after the second page.
That's my use case. Thanks!
Tom
Antonio Petrelli wrote:
2008/3/27, Tom Holmes Jr. <[EMAIL PROTECTED]>:
Ok . maybe what I'll do in thi
2008/3/27, Tom Holmes Jr. <[EMAIL PROTECTED]>:
>
> Ok . maybe what I'll do in this case is put the FormFile into the
> request manually
Isn't it easier to parse the FormFile in the action?
Antonio
Ok . maybe what I'll do in this case is put the FormFile into the
request manually, so I can pass it from one page to the next.
I'm not so much concerned with the FormFile.getInputStream since I can
use FormFile.getFileData to get the byte array data.
Thanks!
Antonio Petrelli wr
persist this without writing it to a database.
You need to parse the input stream as it comes. The reason why the FormFile
does not return an input stream at the following request is that the input
stream is connected to the previous HTTP request.
How you can persist it is a problem of yours, Strut
I have found dozens of examples on the Net to use Struts 1 to upload a
file using the FormFile object.
This works great. However, there is probably a bug in the FormFile
since getting the inputStream doesn't seem to work.
But using the getFileData to get the byte array does work fine, so
FYI, found a workaround for the struts/FormFile issue.
The issue(s)
a) Struts doesn't resolve the file when there is Charset information in the
Content-Type header for a multipart/form-data post.
b) Winhhtp on Vista (dll version 6) adds '; Charset=UTF-8' to the
Content-Type
The fi
Hi There,
I'm setting the header in my VB application without charset property in the
Content type;
winhttp.SetRequestHeader "Content-Type", "multipart/form-data; boundary=xxx
This was using fine and the file was received by struts in the FormFile
object
But now I'm
On 6/8/07, Eric Jain <[EMAIL PROTECTED]> wrote:
I have a form with a FormFile field, which works great, except that when
someone submits a plain string for this field (e.g. a spammer crawling the
site and doing random submissions) I get an ugly stack trace logged... I
wonder is there a
Vincent Lin wrote:
Do you have this setting in your form?
enctype="multipart/form-data"
As mentioned, submissions via the form in the web page work fine. The issue
is that if someone bypasses the form and POSTs an (invalid) non-multipart
request that puts some random string in the parameter
Do you have this setting in your form?
enctype="multipart/form-data"
On 6/8/07, Eric Jain <[EMAIL PROTECTED]> wrote:
I have a form with a FormFile field, which works great, except that when
someone submits a plain string for this field (e.g. a spammer crawling the
site
I have a form with a FormFile field, which works great, except that when
someone submits a plain string for this field (e.g. a spammer crawling the
site and doing random submissions) I get an ugly stack trace logged... I
wonder is there a way to catch this?
2007-06-08 16:04
Hi,
is it possible to use FormFile with struts-faces integration library?
When I set enctype="multipart/form-data" it does not submit my form
anymore.
Thanks,
Rodrigo Pereira
-
To unsubscribe, e-mail: [EMAIL PROT
Can any bosy has sample jsp , bean , action
To handle this Multiple formfile uploads - howto? =
Thanks in advance
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
I have an Action that picks up a file from a JSP and does the processing
that is required. This is working fine.
The code to pick up file is
resumeZipDir = (FormFile) Form.get("resumeZipDir");
Now I am calling the same Action from another Action, and I want the zip
file I
Puneet Lakhina wrote:
Hi,
This is the first time I am using a FormFile. I have a few other fields in
my form along with the field. The problem is when some
validation fails, the value in the text field of the file control gets lost
i.e. the user has to select the file again. Is this normal
Marcolino wrote:
Hi,
a short question:
I have a /createShortEntry and a /createLargeEntry.
I want to limit filesize for /createShortEntry to 250kb and for
/createLargeEntry to 350kb.
is this possible in a simple way?
Thanks, Markus
No, you can only set a max upload size for the application
Hi,
This is the first time I am using a FormFile. I have a few other fields in
my form along with the field. The problem is when some
validation fails, the value in the text field of the file control gets lost
i.e. the user has to select the file again. Is this normal behavior or does
it have to
gt; automatically hand this stream to the browser.
> > - Add an action-mapping to the action
> >
> > HTH,
> > -ed
> >
> > On 10/25/06, Anuraag Shinde <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > In my application i need to allow user to uploa
allow user to upload files, View list of
> > uploaded files and download a specific file.
> > I have sucessfully configured my application to upload the file using
> > FormFile as type for my file field.
> > Now the problem is how to Get data from database and show a down
> I have sucessfully configured my application to upload the file using
> FormFile as type for my file field.
> Now the problem is how to Get data from database and show a downloadable
> link.
>
> There are n number of examples for file upload but none of them cover
the
>
ng to the action
HTH,
-ed
On 10/25/06, Anuraag Shinde <[EMAIL PROTECTED]> wrote:
Hi,
In my application i need to allow user to upload files, View list of
uploaded files and download a specific file.
I have sucessfully configured my application to upload the file using
FormFile as type f
Hi,
In my application i need to allow user to upload files, View list of
uploaded files and download a specific file.
I have sucessfully configured my application to upload the file using
FormFile as type for my file field.
Now the problem is how to Get data from database and show a downloadable
Can you elaborate on this some more?
I followed through the example here:
http://www.roseindia.net/struts/strutsfileupload.shtml.
My ActionForm has a property of FormFile called myFile. Once I'm inside the
Action class, the file upload has already taken place (part of
processPop
Hi,
a short question:
I have a /createShortEntry and a /createLargeEntry.
I want to limit filesize for /createShortEntry to 250kb and for
/createLargeEntry to 350kb.
is this possible in a simple way?
Thanks, Markus
-
To un
AIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Monday, October 23, 2006 2:19 PM
Subject: RE: Re: FormFile getPath() ?
Did you ever get a solution to this?
The filename from FormFile.getFileName() is the client file name, right?
My requirement is that the uploads can be up t
virus scanner against it. So creating another copy
of the file is an extra step for me as well.
It appears that CommonsMultipartRequestHandler processes the request and adds
FormFile elements for each file that is found to a Hash table, but these
elements are of type CommonsFile, and don't
virus scanner against it. So creating another copy
of the file is an extra step for me as well.
-Original Message-
From: Laurent Duparchy [mailto:[EMAIL PROTECTED]
Sent: Monday, October 02, 2006 4:11 AM
To: Struts Users Mailing List
Subject: Re: FormFile getPath() ?
Hi,
thanks but the
Hi,
thanks but the reply but I think it does exactly what I want to avoid
(and what I'm currenlty doing) : Create a second temp file by reading
the inputsream into a new FileOutputStream.
I'm looking into the possibility to get the filepath (when exist) of the
FormFile, not the
;
FormFile file = theForm.getTheFile();
String fileName = file.getFileName();
try {
String filePath =
tempdir + "/" + fileName;
//retrieve the file data
InputStream stream = file.getInputStream();
Hi,
My front-end program upload files and then forward the file path to
another server side program that handle them.
The problem is that I have to read the FormFile data and store it into
another temp file.
It would increase performances this data duplication and have access
directly to
class like this:
public class FormFileWrapper {
private FormFile file;
public FormFile getFile() {
return file;
}
public void setFile(FormFile file) {
this.file = (FormFile)file;
}
}
Created array of of FormFileWrapper called doc[] (and added the
corrsponding
try nested tags for file object in jsp and array of formfile for getter and
setters
mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 13, 2006 6:23 AM
To: Struts Users Mailing List
Subject: Re: FormFile arrays
David Grundberg wrote:
> You are right about the jakarta commons fileupload
r who is using the application. So I
want to store this in an array (FormFile[]) in order to have N number
of files uploaded. When I try to use tags in an iterate
loop (with indexed="true") I get an error about requiring property
attribute. There's isn't a good way of doi
Jeremiah Johnson wrote:
I would like to upload multiple files on a single web page by having
multiple elements. The exact number of these are different
depending on the user who is using the application. So I want to store
this in an array (FormFile[]) in order to have N number of files
ant to store
this in an array (FormFile[]) in order to have N number of files
uploaded. When I try to use tags in an iterate loop (with
indexed="true") I get an error about requiring property attribute.
There's isn't a good way of doing that so I just rendered the the HTML
wi
I would like to upload multiple files on a single web page by having
multiple elements. The exact number of these are different
depending on the user who is using the application. So I want to store
this in an array (FormFile[]) in order to have N number of files
uploaded. When I try to use
What is minimum requirement for file upload configuration in struts.
My ActionForm is in "session" scope in actionmapping.
What are precautions to configuring declaritively in struts-config.xml or in
action in order to avoid unwanted thread/IO stream hanging or some other
problems.
After file
We are using FormFile to do file uploads. Everything has been working
fine with the app for months now. Yesterday we put the application
behind SSL, and now file upload no longer works. In the action class,
when we get the FormFile out of the form, it is null. Is there
something we have to
The basic LazyDynaBean implementation tried to be smart about
instantiating objects - so that people's regular POJO beans would get
automtaically created. In hindsight IMO this was a mistake. It is
however easy to remedy - by overriding the createOtherProperty()
method - see the "4. Automatic Prope
Hi,
I've got a form-bean definition like so:
...
When I load the page the first time, I get an instantiation exception:
java.lang.InstantiationException: org.apache.struts.upload.FormFile
It doesn't seriously affect the application, but I'm curious about the
solut
rch 01, 2006 5:11 PM
> Ben gmail.com> writes:
>
> >
> > I defined an ActionForm of which it has a FormFile. Prepopulation is
> > not needed for this ActionForm. Configuring this ActionForm is similar
> > to any other forms and here is the exception. I get this exception
Ben gmail.com> writes:
>
> I defined an ActionForm of which it has a FormFile. Prepopulation is
> not needed for this ActionForm. Configuring this ActionForm is similar
> to any other forms and here is the exception. I get this exception
> when I startup/shutdown Tomcat.
..
"Struts Mailing List"
cc
Subject
FormFile validation
Hi all,
I have a formfile
and a bean with getters and setters.
When validation fails, the other fields get the values already inserted,
but
the file input field gets empty and must be reselected.
Is this normal, or is ther
Hi all,
I have a formfile
and a bean with getters and setters.
When validation fails, the other fields get the values already inserted, but
the file input field gets empty and must be reselected.
Is this normal, or is there a way to keep the file location in the input
field?
thanks,
Markus
Daniel Kies wrote:
Does anyone know of a validator that can be plugged into the validator
framework that will check file types for FormFile? This would be so a user
can't upload certain extensions like .exe and the application will catch it..
There's nothing in the standard set of
quot;);
} else {
System.out.prinlnt("Format=" + desc.getShortName() + ", MIME type=" +
desc.getMimeType());
}
=== ===
Warning: If LGPL licenses bother you, don't use it.
Regards,
David
-Original Message-
From: Daniel Kies [mailto:[EMAIL PROTECTED]
Sent: Monday, Janu
Does anyone know of a validator that can be plugged into the validator
framework that will check file types for FormFile? This would be so a user
can't upload certain extensions like .exe and the application will catch it.
thanks.
On 12/24/05, Kedar Panse <[EMAIL PROTECTED]> wrote:
> Thanks, That would work. But still I'll have to have FormFile in to
> ActionForm which is not seriliazable. Giving me error
>
> IOException while loading persisted sessions: java.io.WriteAbortedExcep
Thanks, That would work. But still I'll have to have FormFile in to
ActionForm which is not seriliazable. Giving me error
IOException while loading persisted sessions: java.io.WriteAbortedException:
writing aborted; java.io.NotSerializableExce
1 - 100 of 131 matches
Mail list logo