[prev in list] [next in list] [prev in thread] [next in thread]
List: tapestry-user
Subject: Re: [Ext] Re: file upload doesn't set file value
From: Dongmei Cao <dongmei.cao () icann ! org>
Date: 2017-12-14 19:55:36
Message-ID: 80539E91-CBDA-4762-8774-24BDDE695C07 () icann ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thanks for your example! Just for anyone who might run into to the same issue. It was \
the SpringBoot causing the issue for our case (we migrated to SpringBoot as we \
upgrade the Tapestry version). Had to specify a Multipart File Size in SpringBoot to \
have it work properly.
Dongmei
From: yazmin georgina quintal <geolita67@yahoo.com.mx>
Reply-To: yazmin georgina quintal <geolita67@yahoo.com.mx>
Date: Wednesday, December 13, 2017 at 6:38 AM
To: Tapestry users <users@tapestry.apache.org>, Dongmei Cao <dongmei.cao@icann.org>
Subject: Re: [Ext] Re: file upload doesn't set file value
Do not know SpringBoot.
I add my test page, but I do not see any difference with your, and my dependency is \
simply
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-upload</artifactId>
<version>5.4.3</version>
</dependency>
On the browser, do you select the file to be send/post during your test ? I know, \
really simply but ... I though this because the required validation is probably been \
done on client side.
Saludos.
Atte. Yazmín Georgina Quintal Moo
Local 63 y 64 de Plaza de la Tecnología. Villahermosa, Tab.
Tel 993 1311688
Cel. 9931 689207
El martes, 12 de diciembre de 2017 21:45:56 GMT-6, Dongmei Cao \
<dongmei.cao@icann.org> escribió:
1) I have the following dependencies
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-upload</artifactId>
<version5.4.3version>
</dependency>
Tried with and without the following two. Didn't make any difference:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
2) Since I have the validate="required" in the .tml, it always display error message \
"You must provide a value for File". It didn't even get to the onSuccess(). If I \
remove the validate="required", it got to the onSuccess. But the file is null. So, \
yes, it throws NPE when trying file.getFileName().
3) I'm using it with SpringBoot. Not sure if that will make any difference.
Thanks,
Dongmei
From: yazmin georgina quintal <geolita67@yahoo.com.mx>
Reply-To: yazmin georgina quintal <geolita67@yahoo.com.mx>
Date: Tuesday, December 12, 2017 at 5:20 PM
To: Tapestry users <users@tapestry.apache.org>, Dongmei Cao <dongmei.cao@icann.org>
Subject: [Ext] Re: file upload doesn't set file value
I am using it and it is working ok:
1. Did you add depedency to tapestry-fileupload module ?.
2. Does it throws a Null Pointer Exception or simply you do not see then file created \
? 3. The path in "copied" File instance must exist, the method write will not create \
it.
I recently begun to use it without trouble.
Saludos.
Atte. Yazmín Georgina Quintal Moo
Local 63 y 64 de Plaza de la Tecnología. Villahermosa, Tab.
Tel 993 1311688
Cel. 9931 689207
El martes, 12 de diciembre de 2017 18:37:49 GMT-6, Dongmei Cao \
<dongmei.cao@icann.org> escribió:
Hi,
I know this is an old post. I'm trying to migrate our app from 5.3.8 to 5.4.3, and \
finding the file upload is no longer working. I'm not using t:zone at all. But the \
file value is always null. I see the JumpStart site \
(http://jumpstart.doublenegative.com.au/jumpstart/[jumpstart.doublenegative.com.au][jumpstart.doublenegative.com.au]) \
have the "File Upload" example disabled. Anyone has a working example. Could you \
please share?
<t:form>
<t:errors/>
<input t:type="upload" t:id="file" t:value="file" validate="required"/> <br/>
<input type="submit" value="Upload"/>
</t:form>
@Persist
@Property
private UploadedFile file;
public Object onSuccess() {
System.out.println(file.getFileName());
File copied = new File("/my/file/location/" + file.getFileName());
file.write(copied);
return this;
}
Thanks,
Dongmei
On 9/1/16, 12:50 AM, "Chris Poulsen" <mailinglist@nesluop.dk> wrote:
Unfortunately I think Carlos is correct.
--
Chris
On Wed, Aug 31, 2016 at 11:18 PM, Pavel Chernyak <fjfalcon@fjfalcon.ru>
wrote:
> Hi there.
>
> Maybe you shall anotate field file @Persist?
>
>
> On 31 August 2016 at 23:03, Qbyte Consulting <qbyteconsulting@gmail.com>
> wrote:
>
> >
> > I'm always finding that file is null for file upload? If I submit the
> form
> > without async=true then file value is set and it works.
> >
>
>
> --
> With best regards.
> Pavel Chernyak
>
[Attachment #5 (text/html)]
<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Title content=""><meta \
name=Keywords content=""><meta http-equiv=Content-Type content="text/html; \
charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered \
medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Helvetica Neue";
panose-1:2 0 5 3 0 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal>Thanks for your example! Just for anyone who \
might run into to the same issue. It was the SpringBoot causing the issue for our \
case (we migrated to SpringBoot as we upgrade the Tapestry version). Had to specify a \
Multipart File Size in SpringBoot to have it work properly.<o:p></o:p></p><p \
class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Dongmei<o:p></o:p></p><p \
class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #B5C4DF \
1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span \
style='font-size:12.0pt;color:black'>From: </span></b><span \
style='font-size:12.0pt;color:black'>yazmin georgina quintal \
<geolita67@yahoo.com.mx><br><b>Reply-To: </b>yazmin georgina quintal \
<geolita67@yahoo.com.mx><br><b>Date: </b>Wednesday, December 13, 2017 at 6:38 \
AM<br><b>To: </b>Tapestry users <users@tapestry.apache.org>, Dongmei Cao \
<dongmei.cao@icann.org><br><b>Subject: </b>Re: [Ext] Re: file upload doesn't \
set file value<o:p></o:p></span></p></div><div><p \
class=MsoNormal><o:p> </o:p></p></div><div><div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'>Do not know \
SpringBoot.<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'>I add my test page, \
but I do not see any difference with your, and my dependency is \
simply<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'> \
<dependency><br> \
<groupId>org.apache.tapestry</groupId><br> \
\
<artifactId>tapestry-upload</artifactId><br> \
\
<version>5.4.3</version><br> \
</dependency><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'>On the browser, do \
you select the file to be send/post during your test ? I know, really simply but ... \
I though this because the required validation is probably been done on client \
side.<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'>Saludos.<o:p></o:p></span></p><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'>Atte. Yazmín \
Georgina Quintal Moo <o:p></o:p></span></p></div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica Neue",sans-serif'>Local 63 y 64 de \
Plaza de la Tecnología. Villahermosa, Tab. <br>Tel 993 1311688 <br>Cel. 9931 \
689207<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:12.0pt;font-family:"Helvetica \
Neue",sans-serif'><o:p> </o:p></span></p></div><div \
id="yahoo_quoted_3490708795"><div><div><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Helvetica Neue",sans-serif;color:#26282A'>El \
martes, 12 de diciembre de 2017 21:45:56 GMT-6, Dongmei Cao \
<dongmei.cao@icann.org> escribió: <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Helvetica \
Neue",sans-serif;color:#26282A'><o:p> </o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Helvetica \
Neue",sans-serif;color:#26282A'><o:p> </o:p></span></p></div><div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Helvetica \
Neue",sans-serif;color:#26282A'>1) I have the following \
dependencies<br><br><dependency><br> \
<groupId>org.apache.tapestry</groupId><br> \
<artifactId>tapestry-upload</artifactId><br> \
<version5.4.3version><br></dependency><br><br>Tried with and without the \
following two. Didn't make any difference:<br><br><dependency><br> \
<groupId>commons-fileupload</groupId><br> \
<artifactId>commons-fileupload</artifactId><br> \
<version>1.3.2</version><br></dependency><br><br><dependency><br> \
<groupId>commons-io</groupId><br> \
<artifactId>commons-io</artifactId><br> \
<version>2.4</version><br></dependency><br><br>2) Since I have the \
validate="required" in the .tml, it always display error message "You must \
provide a value for File". It didn't even get to the onSuccess(). If I remove the \
validate="required", it got to the onSuccess. But the file is null. So, \
yes, it throws NPE when trying file.getFileName().<br><br>3) I'm using it with \
SpringBoot. Not sure if that will make any \
difference.<br><br>Thanks,<br>Dongmei<br><br><br>From: yazmin georgina quintal <<a \
href="mailto:geolita67@yahoo.com.mx">geolita67@yahoo.com.mx</a>><br>Reply-To: \
yazmin georgina quintal <<a \
href="mailto:geolita67@yahoo.com.mx">geolita67@yahoo.com.mx</a>><br>Date: Tuesday, \
December 12, 2017 at 5:20 PM<br>To: Tapestry users <<a \
href="mailto:users@tapestry.apache.org">users@tapestry.apache.org</a>>, Dongmei \
Cao <<a href="mailto:dongmei.cao@icann.org">dongmei.cao@icann.org</a>><br>Subject: \
[Ext] Re: file upload doesn't set file value<br><br>I am using it and it is working \
ok:<br><br>1. Did you add depedency to tapestry-fileupload module ?.<br>2. Does it \
throws a Null Pointer Exception or simply you do not see then file created ?<br>3. \
The path in "copied" File instance must exist, the method write will not \
create it.<br><br>I recently begun to use it without \
trouble.<br><br>Saludos.<br>Atte. Yazmín Georgina Quintal Moo <br>Local 63 y 64 de \
Plaza de la Tecnología. Villahermosa, Tab. <br>Tel 993 1311688 <br>Cel. 9931 \
689207<br><br><br>El martes, 12 de diciembre de 2017 18:37:49 GMT-6, Dongmei Cao \
<<a href="mailto:dongmei.cao@icann.org">dongmei.cao@icann.org</a>> escribió: \
<br><br><br>Hi,<br><br>I know this is an old post. I'm trying to migrate our app from \
5.3.8 to 5.4.3, and finding the file upload is no longer working. I'm not using \
t:zone at all. But the file value is always null. I see the JumpStart site (<a \
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__jumpstart.doublenegative.com \
.au_jumpstart_&d=DwMFaQ&c=FmY1u3PJp6wrcrwll3mSVzgfkbPSS6sJms7xcl4I5cM&r=2z \
1riFMXKMf_hbDJyPHriu7_4_IwytJZgQJzCNqy_QY&m=DugQdN_18mBr_zhiz9ftF7gXwnKLvxrvmztleDsgT6Q&s=KY6h9cN8_vKemdQm_tByZlMDqY46OaJkhPlRe45B_TQ&e=" \
target="_blank">http://jumpstart.doublenegative.com.au/jumpstart/[jumpstart.doublenegative.com.au]</a>[jumpstart.doublenegative.com.au]) \
have the "File Upload" example disabled. Anyone has a working example. Could you \
please share? <o:p></o:p></span></p><div id=yqtfd58749><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Helvetica \
Neue",sans-serif;color:#26282A'><br><br><t:form><br> \
<t:errors/><br> <input t:type="upload" \
t:id="file" t:value="file" validate="required"/> \
<br/><br> <input type="submit" \
value="Upload"/><br></t:form><br><br><br> \
@Persist<br> @Property<br> private UploadedFile \
file;<br><br> public Object onSuccess() {<br> \
System.out.println(file.getFileName());<br> File copied = \
new File("/my/file/location/" + file.getFileName());<br> \
file.write(copied);<br><br> return \
this;<br> }<br><br>Thanks,<br>Dongmei<br><br>On 9/1/16, 12:50 AM, \
"Chris Poulsen" <<a \
href="mailto:mailinglist@nesluop.dk">mailinglist@nesluop.dk</a>> \
wrote:<br><br> Unfortunately I think Carlos is correct.<br> \
<br> -- <br> Chris<br> <br> On \
Wed, Aug 31, 2016 at 11:18 PM, Pavel Chernyak <<a \
href="mailto:fjfalcon@fjfalcon.ru">fjfalcon@fjfalcon.ru</a>><br> \
wrote:<br> <br> > Hi there.<br> \
><br> > Maybe you shall anotate field file @Persist?<br> \
><br> ><br> > On 31 August 2016 at 23:03, \
Qbyte Consulting <<a \
href="mailto:qbyteconsulting@gmail.com">qbyteconsulting@gmail.com</a>><br> \
> wrote:<br> ><br> > ><br> \
> > I'm always finding that file is null for file upload? If I submit \
the<br> > form<br> > > without async=true then \
file value is set and it works.<br> > ><br> \
><br> ><br> > --<br> > With best \
regards.<br> > Pavel Chernyak<br> ><br> \
<o:p></o:p></span></p></div></div></div></div></div></div></div></body></html>
["smime.p7s" (application/pkcs7-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic