--- 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
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
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);
the data will be generated dynamically , depending on others selected fields
and based on a select to a database table, i will generate a csv file
2008/12/15 Robert Graf-Waczenski
> Hm. Sounds more like a download, not like an upload. Is that what you're
> after?
>
> Robert
>
>
> elyes sallem
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
Hm. Sounds more like a download, not like an upload. Is that what you're
after?
Robert
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
That's what the "Save As" dialog is for.
Nils-H
On Mon, Dec 15, 2008 at 3:03 PM, 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 an
--- 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
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
2008/12/15 Dave Newton
> --- On Mon, 12/15/08, elyes sallem wrote:
> > it is no
--- On Mon, 12/15/08, elyes sallem wrote:
> 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 the struts tag
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.
25 matches
Mail list logo