You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Valentin Avksentyev <va...@360works.com> on 2011/02/02 19:52:25 UTC
File upload progress bar
Hi I've been beating my head against the wall with this.
I'm overriding newWebRequest in my Application class:
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest)
{
return new UploadWebRequest(servletRequest);
}
Here is the code in my upload panel class:
Form<Void> uploadform = new Form<Void>("fileUploadForm") {
@Override
protected void onSubmit() {
final FileUpload upload = fileUploadField.getFileUpload();
if (upload != null) {
try {
File newFile = new File(uploadFolder, upload.getClientFileName() );
// Save to new file
newFile.createNewFile();
upload.writeTo(newFile);
_processSelection(server, newFile, destFolder);
} catch (Exception e) {
throw new RuntimeException("Unable to write file");
}
} else {
throw new RuntimeException( "file selected for upload is empty" );
}
}
};
uploadform.setMultiPart(true);
uploadform.setMaxSize(Bytes.gigabytes(1));
uploadform.add(fileUploadField = new FileUploadField("fileInput"));
uploadform.add(new UploadProgressBar("progress", uploadform));
uploadform.add( new UploadValidator(fileUploadField, prefix) );
add( uploadform );
This is based on the examples, the examples themselves are not working for me either:
I tried, http://wicketstuff.org/wicket13/upload and http://www.wicket-library.com/wicket-examples/upload/ (the latter URL kinda works, it increments the remaining time but does not track the progress)
What am I doing wrong
-Valentin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by moèz ben rhouma <be...@gmail.com>.
If the example doesn't work so I think the problem in your browser. Try to
empty the cache, cookies, histories ... and tries again.
2011/2/2 Valentin Avksentyev <va...@360works.com>
> Hi I've been beating my head against the wall with this.
>
> I'm overriding newWebRequest in my Application class:
> @Override
> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
> {
> return new UploadWebRequest(servletRequest);
> }
>
> Here is the code in my upload panel class:
> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
> @Override
> protected void onSubmit() {
> final FileUpload upload =
> fileUploadField.getFileUpload();
> if (upload != null) {
> try {
> File newFile = new
> File(uploadFolder, upload.getClientFileName() );
> // Save to new file
> newFile.createNewFile();
> upload.writeTo(newFile);
> _processSelection(server,
> newFile, destFolder);
> } catch (Exception e) {
> throw new
> RuntimeException("Unable to write file");
> }
> } else {
> throw new RuntimeException( "file
> selected for upload is empty" );
> }
> }
> };
> uploadform.setMultiPart(true);
> uploadform.setMaxSize(Bytes.gigabytes(1));
>
> uploadform.add(fileUploadField = new
> FileUploadField("fileInput"));
> uploadform.add(new UploadProgressBar("progress",
> uploadform));
> uploadform.add( new UploadValidator(fileUploadField, prefix)
> );
> add( uploadform );
>
>
> This is based on the examples, the examples themselves are not working for
> me either:
> I tried, http://wicketstuff.org/wicket13/upload and
> http://www.wicket-library.com/wicket-examples/upload/ (the latter URL
> kinda works, it increments the remaining time but does not track the
> progress)
>
> What am I doing wrong
>
> -Valentin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
RE: File upload progress bar
Posted by "Schaaf van der, Haiko H (NSC)" <Ha...@NS.NL>.
Ik kom het aankomende week ophalen.
Haiko van der Schaaf
NS Reizigers
CC-Internet, Business Systemen
Laan van Puntenburg 100
Postbus 2025
3500 HA Utrecht
T 06 - 18515494
www.ns.nl
-----Oorspronkelijk bericht-----
Van: Valentin Avksentyev [mailto:val@360works.com]
Verzonden: vrijdag 4 februari 2011 14:18
Aan: users@wicket.apache.org
Onderwerp: Re: File upload progress bar
So has anyone out there has been able to get the upload progress bar
working? If so, please advise.
I definitely don't mind putting together a quickstart, are there
directions for that anywhere?
-Valentin
On Feb 3, 2011, at 10:18 AM, Valentin Avksentyev wrote:
> No I'm testing on my own machine, with a 300Mb file, in fact Chrome
gives me upload feedback, but nothing from the upload progress bar.
>
> Here is the code I'm using:
>
> I'm overriding newWebRequest in my Application class:
> @Override
> protected WebRequest newWebRequest(HttpServletRequest
servletRequest)
> {
> return new UploadWebRequest(servletRequest);
> }
>
> Here is the code in my upload panel class:
> Form<Void> uploadform = new Form<Void>("fileUploadForm")
{
> @Override
> protected void onSubmit() {
> final FileUpload upload =
fileUploadField.getFileUpload();
> if (upload != null) {
> try {
> File newFile = new
File(uploadFolder, upload.getClientFileName() );
> // Save to new file
> newFile.createNewFile();
> upload.writeTo(newFile);
>
_processSelection(server, newFile, destFolder);
> } catch (Exception e) {
> throw new
RuntimeException("Unable to write file");
> }
> } else {
> throw new RuntimeException(
"file selected for upload is empty" );
> }
> }
> };
> uploadform.setMultiPart(true);
> uploadform.setMaxSize(Bytes.gigabytes(1));
>
> uploadform.add(fileUploadField = new
FileUploadField("fileInput"));
> uploadform.add(new UploadProgressBar("progress",
uploadform));
> uploadform.add( new UploadValidator(fileUploadField,
prefix) );
> add( uploadform );
>
>
> On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
>
>> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
>>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
>>>>
>>>> The files get uploaded just fine in my app, but no progress is
>>>> tracked.
>>>>
>>>> It's definitely hard to verify if the progress bar works in the
>>>> example sites, with a limit of 100k, I haven't tried throttling my
>>>> upload speed, I guess I should try that next.
>>>
>>> Any suggestions?
>>
>> Is your application runnning behind a proxy? If so, maybe the entire
>> client request will be buffered by the proxy before being passed on
>> to the backend proxied servers. As a result, upload progress meters
>> will not function correctly if they work by measuring the data
>> received by the backend servers.
>>
>> -Timo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by azatmar <az...@gmail.com>.
PLease add in WicketApplication class in init() method
getApplicationSettings().setUploadProgressUpdatesEnabled(true);
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/File-upload-progress-bar-tp3255359p4331533.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Valentin Avksentyev <va...@360works.com>.
I want clarify that the issue on Mac OS X is only with webkit browsers, I tested Safari and Chrome
There is no issue when using Firefox, progress bar tracks progress correctly.
Added an issue ticket https://issues.apache.org/jira/browse/WICKET-3443
-Valentin
On Feb 4, 2011, at 10:17 AM, Pedro Santos wrote:
> Hi Valentin, your code looks good, please fill an ticket with an quickstar
> reproducing the problem.
>
> On Fri, Feb 4, 2011 at 11:21 AM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> http://wicket.apache.org/start/quickstart.html
>>
>> On Fri, Feb 4, 2011 at 8:17 AM, Valentin Avksentyev <va...@360works.com>
>> wrote:
>>> So has anyone out there has been able to get the upload progress bar
>> working? If so, please advise.
>>>
>>> I definitely don't mind putting together a quickstart, are there
>> directions for that anywhere?
>>>
>>> -Valentin
>>>
>>> On Feb 3, 2011, at 10:18 AM, Valentin Avksentyev wrote:
>>>
>>>> No I'm testing on my own machine, with a 300Mb file, in fact Chrome
>> gives me upload feedback, but nothing from the upload progress bar.
>>>>
>>>> Here is the code I'm using:
>>>>
>>>> I'm overriding newWebRequest in my Application class:
>>>> @Override
>>>> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
>>>> {
>>>> return new UploadWebRequest(servletRequest);
>>>> }
>>>>
>>>> Here is the code in my upload panel class:
>>>> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
>>>> @Override
>>>> protected void onSubmit() {
>>>> final FileUpload upload =
>> fileUploadField.getFileUpload();
>>>> if (upload != null) {
>>>> try {
>>>> File newFile = new
>> File(uploadFolder, upload.getClientFileName() );
>>>> // Save to new file
>>>> newFile.createNewFile();
>>>> upload.writeTo(newFile);
>>>> _processSelection(server,
>> newFile, destFolder);
>>>> } catch (Exception e) {
>>>> throw new
>> RuntimeException("Unable to write file");
>>>> }
>>>> } else {
>>>> throw new RuntimeException( "file
>> selected for upload is empty" );
>>>> }
>>>> }
>>>> };
>>>> uploadform.setMultiPart(true);
>>>> uploadform.setMaxSize(Bytes.gigabytes(1));
>>>>
>>>> uploadform.add(fileUploadField = new
>> FileUploadField("fileInput"));
>>>> uploadform.add(new UploadProgressBar("progress",
>> uploadform));
>>>> uploadform.add( new UploadValidator(fileUploadField,
>> prefix) );
>>>> add( uploadform );
>>>>
>>>>
>>>> On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
>>>>
>>>>> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
>>>>>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
>>>>>>>
>>>>>>> The files get uploaded just fine in my app, but no progress
>>>>>>> is tracked.
>>>>>>>
>>>>>>> It's definitely hard to verify if the progress bar works in
>>>>>>> the example sites, with a limit of 100k, I haven't tried
>>>>>>> throttling my upload speed, I guess I should try that next.
>>>>>>
>>>>>> Any suggestions?
>>>>>
>>>>> Is your application runnning behind a proxy? If so, maybe the
>>>>> entire client request will be buffered by the proxy before
>>>>> being passed on to the backend proxied servers. As a result,
>>>>> upload progress meters will not function correctly if they work
>>>>> by measuring the data received by the backend servers.
>>>>>
>>>>> -Timo
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
Re: File upload progress bar
Posted by Pedro Santos <pe...@gmail.com>.
Hi Valentin, your code looks good, please fill an ticket with an quickstar
reproducing the problem.
On Fri, Feb 4, 2011 at 11:21 AM, James Carman <ja...@carmanconsulting.com>wrote:
> http://wicket.apache.org/start/quickstart.html
>
> On Fri, Feb 4, 2011 at 8:17 AM, Valentin Avksentyev <va...@360works.com>
> wrote:
> > So has anyone out there has been able to get the upload progress bar
> working? If so, please advise.
> >
> > I definitely don't mind putting together a quickstart, are there
> directions for that anywhere?
> >
> > -Valentin
> >
> > On Feb 3, 2011, at 10:18 AM, Valentin Avksentyev wrote:
> >
> >> No I'm testing on my own machine, with a 300Mb file, in fact Chrome
> gives me upload feedback, but nothing from the upload progress bar.
> >>
> >> Here is the code I'm using:
> >>
> >> I'm overriding newWebRequest in my Application class:
> >> @Override
> >> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
> >> {
> >> return new UploadWebRequest(servletRequest);
> >> }
> >>
> >> Here is the code in my upload panel class:
> >> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
> >> @Override
> >> protected void onSubmit() {
> >> final FileUpload upload =
> fileUploadField.getFileUpload();
> >> if (upload != null) {
> >> try {
> >> File newFile = new
> File(uploadFolder, upload.getClientFileName() );
> >> // Save to new file
> >> newFile.createNewFile();
> >> upload.writeTo(newFile);
> >> _processSelection(server,
> newFile, destFolder);
> >> } catch (Exception e) {
> >> throw new
> RuntimeException("Unable to write file");
> >> }
> >> } else {
> >> throw new RuntimeException( "file
> selected for upload is empty" );
> >> }
> >> }
> >> };
> >> uploadform.setMultiPart(true);
> >> uploadform.setMaxSize(Bytes.gigabytes(1));
> >>
> >> uploadform.add(fileUploadField = new
> FileUploadField("fileInput"));
> >> uploadform.add(new UploadProgressBar("progress",
> uploadform));
> >> uploadform.add( new UploadValidator(fileUploadField,
> prefix) );
> >> add( uploadform );
> >>
> >>
> >> On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
> >>
> >>> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
> >>>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
> >>>>>
> >>>>> The files get uploaded just fine in my app, but no progress
> >>>>> is tracked.
> >>>>>
> >>>>> It's definitely hard to verify if the progress bar works in
> >>>>> the example sites, with a limit of 100k, I haven't tried
> >>>>> throttling my upload speed, I guess I should try that next.
> >>>>
> >>>> Any suggestions?
> >>>
> >>> Is your application runnning behind a proxy? If so, maybe the
> >>> entire client request will be buffered by the proxy before
> >>> being passed on to the backend proxied servers. As a result,
> >>> upload progress meters will not function correctly if they work
> >>> by measuring the data received by the backend servers.
> >>>
> >>> -Timo
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos
Re: File upload progress bar
Posted by James Carman <ja...@carmanconsulting.com>.
http://wicket.apache.org/start/quickstart.html
On Fri, Feb 4, 2011 at 8:17 AM, Valentin Avksentyev <va...@360works.com> wrote:
> So has anyone out there has been able to get the upload progress bar working? If so, please advise.
>
> I definitely don't mind putting together a quickstart, are there directions for that anywhere?
>
> -Valentin
>
> On Feb 3, 2011, at 10:18 AM, Valentin Avksentyev wrote:
>
>> No I'm testing on my own machine, with a 300Mb file, in fact Chrome gives me upload feedback, but nothing from the upload progress bar.
>>
>> Here is the code I'm using:
>>
>> I'm overriding newWebRequest in my Application class:
>> @Override
>> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
>> {
>> return new UploadWebRequest(servletRequest);
>> }
>>
>> Here is the code in my upload panel class:
>> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
>> @Override
>> protected void onSubmit() {
>> final FileUpload upload = fileUploadField.getFileUpload();
>> if (upload != null) {
>> try {
>> File newFile = new File(uploadFolder, upload.getClientFileName() );
>> // Save to new file
>> newFile.createNewFile();
>> upload.writeTo(newFile);
>> _processSelection(server, newFile, destFolder);
>> } catch (Exception e) {
>> throw new RuntimeException("Unable to write file");
>> }
>> } else {
>> throw new RuntimeException( "file selected for upload is empty" );
>> }
>> }
>> };
>> uploadform.setMultiPart(true);
>> uploadform.setMaxSize(Bytes.gigabytes(1));
>>
>> uploadform.add(fileUploadField = new FileUploadField("fileInput"));
>> uploadform.add(new UploadProgressBar("progress", uploadform));
>> uploadform.add( new UploadValidator(fileUploadField, prefix) );
>> add( uploadform );
>>
>>
>> On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
>>
>>> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
>>>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
>>>>>
>>>>> The files get uploaded just fine in my app, but no progress
>>>>> is tracked.
>>>>>
>>>>> It's definitely hard to verify if the progress bar works in
>>>>> the example sites, with a limit of 100k, I haven't tried
>>>>> throttling my upload speed, I guess I should try that next.
>>>>
>>>> Any suggestions?
>>>
>>> Is your application runnning behind a proxy? If so, maybe the
>>> entire client request will be buffered by the proxy before
>>> being passed on to the backend proxied servers. As a result,
>>> upload progress meters will not function correctly if they work
>>> by measuring the data received by the backend servers.
>>>
>>> -Timo
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Valentin Avksentyev <va...@360works.com>.
So has anyone out there has been able to get the upload progress bar working? If so, please advise.
I definitely don't mind putting together a quickstart, are there directions for that anywhere?
-Valentin
On Feb 3, 2011, at 10:18 AM, Valentin Avksentyev wrote:
> No I'm testing on my own machine, with a 300Mb file, in fact Chrome gives me upload feedback, but nothing from the upload progress bar.
>
> Here is the code I'm using:
>
> I'm overriding newWebRequest in my Application class:
> @Override
> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
> {
> return new UploadWebRequest(servletRequest);
> }
>
> Here is the code in my upload panel class:
> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
> @Override
> protected void onSubmit() {
> final FileUpload upload = fileUploadField.getFileUpload();
> if (upload != null) {
> try {
> File newFile = new File(uploadFolder, upload.getClientFileName() );
> // Save to new file
> newFile.createNewFile();
> upload.writeTo(newFile);
> _processSelection(server, newFile, destFolder);
> } catch (Exception e) {
> throw new RuntimeException("Unable to write file");
> }
> } else {
> throw new RuntimeException( "file selected for upload is empty" );
> }
> }
> };
> uploadform.setMultiPart(true);
> uploadform.setMaxSize(Bytes.gigabytes(1));
>
> uploadform.add(fileUploadField = new FileUploadField("fileInput"));
> uploadform.add(new UploadProgressBar("progress", uploadform));
> uploadform.add( new UploadValidator(fileUploadField, prefix) );
> add( uploadform );
>
>
> On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
>
>> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
>>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
>>>>
>>>> The files get uploaded just fine in my app, but no progress
>>>> is tracked.
>>>>
>>>> It's definitely hard to verify if the progress bar works in
>>>> the example sites, with a limit of 100k, I haven't tried
>>>> throttling my upload speed, I guess I should try that next.
>>>
>>> Any suggestions?
>>
>> Is your application runnning behind a proxy? If so, maybe the
>> entire client request will be buffered by the proxy before
>> being passed on to the backend proxied servers. As a result,
>> upload progress meters will not function correctly if they work
>> by measuring the data received by the backend servers.
>>
>> -Timo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Valentin Avksentyev <va...@360works.com>.
No I'm testing on my own machine, with a 300Mb file, in fact Chrome gives me upload feedback, but nothing from the upload progress bar.
Here is the code I'm using:
I'm overriding newWebRequest in my Application class:
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest)
{
return new UploadWebRequest(servletRequest);
}
Here is the code in my upload panel class:
Form<Void> uploadform = new Form<Void>("fileUploadForm") {
@Override
protected void onSubmit() {
final FileUpload upload = fileUploadField.getFileUpload();
if (upload != null) {
try {
File newFile = new File(uploadFolder, upload.getClientFileName() );
// Save to new file
newFile.createNewFile();
upload.writeTo(newFile);
_processSelection(server, newFile, destFolder);
} catch (Exception e) {
throw new RuntimeException("Unable to write file");
}
} else {
throw new RuntimeException( "file selected for upload is empty" );
}
}
};
uploadform.setMultiPart(true);
uploadform.setMaxSize(Bytes.gigabytes(1));
uploadform.add(fileUploadField = new FileUploadField("fileInput"));
uploadform.add(new UploadProgressBar("progress", uploadform));
uploadform.add( new UploadValidator(fileUploadField, prefix) );
add( uploadform );
On Feb 3, 2011, at 12:37 AM, Timo Schmidt wrote:
> On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
>> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
>>>
>>> The files get uploaded just fine in my app, but no progress
>>> is tracked.
>>>
>>> It's definitely hard to verify if the progress bar works in
>>> the example sites, with a limit of 100k, I haven't tried
>>> throttling my upload speed, I guess I should try that next.
>>
>> Any suggestions?
>
> Is your application runnning behind a proxy? If so, maybe the
> entire client request will be buffered by the proxy before
> being passed on to the backend proxied servers. As a result,
> upload progress meters will not function correctly if they work
> by measuring the data received by the backend servers.
>
> -Timo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Timo Schmidt <wi...@xomit.de>.
On Wed 02.02.2011 23:49, Valentin Avksentyev wrote:
> On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
> >
> > The files get uploaded just fine in my app, but no progress
> > is tracked.
> >
> > It's definitely hard to verify if the progress bar works in
> > the example sites, with a limit of 100k, I haven't tried
> > throttling my upload speed, I guess I should try that next.
>
> Any suggestions?
Is your application runnning behind a proxy? If so, maybe the
entire client request will be buffered by the proxy before
being passed on to the backend proxied servers. As a result,
upload progress meters will not function correctly if they work
by measuring the data received by the backend servers.
-Timo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Valentin Avksentyev <va...@360works.com>.
Any suggestions?
-Valentin
On Feb 2, 2011, at 2:22 PM, Valentin Avksentyev wrote:
> The files get uploaded just fine in my app, but no progress is tracked.
>
> It's definitely hard to verify if the progress bar works in the example sites, with a limit of 100k, I haven't tried throttling my upload speed, I guess I should try that next.
>
> -Valentin
>
> On Feb 2, 2011, at 2:20 PM, Michael O'Cleirigh wrote:
>
>> Hello,
>>
>> Have you looked at the wicket 1.4 examples here: http://wicketstuff.org/wicket14/upload (this is the source into the github mirror: https://github.com/apache/wicket/tree/wicket-1.4.x/wicket-examples)
>>
>> I tried both and they work to upload I'm not sure on the progress bar as I used a file that was too small and it blinked by.
>>
>> The upload limit in the 1.4 example is 100k but yours in 1 GB which could be why your upload test is failing.
>>
>> Regards,
>>
>> Mike
>>> Hi I've been beating my head against the wall with this.
>>>
>>> I'm overriding newWebRequest in my Application class:
>>> @Override
>>> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
>>> {
>>> return new UploadWebRequest(servletRequest);
>>> }
>>>
>>> Here is the code in my upload panel class:
>>> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
>>> @Override
>>> protected void onSubmit() {
>>> final FileUpload upload = fileUploadField.getFileUpload();
>>> if (upload != null) {
>>> try {
>>> File newFile = new File(uploadFolder, upload.getClientFileName() );
>>> // Save to new file
>>> newFile.createNewFile();
>>> upload.writeTo(newFile);
>>> _processSelection(server, newFile, destFolder);
>>> } catch (Exception e) {
>>> throw new RuntimeException("Unable to write file");
>>> }
>>> } else {
>>> throw new RuntimeException( "file selected for upload is empty" );
>>> }
>>> }
>>> };
>>> uploadform.setMultiPart(true);
>>> uploadform.setMaxSize(Bytes.gigabytes(1));
>>>
>>> uploadform.add(fileUploadField = new FileUploadField("fileInput"));
>>> uploadform.add(new UploadProgressBar("progress", uploadform));
>>> uploadform.add( new UploadValidator(fileUploadField, prefix) );
>>> add( uploadform );
>>>
>>>
>>> This is based on the examples, the examples themselves are not working for me either:
>>> I tried, http://wicketstuff.org/wicket13/upload and http://www.wicket-library.com/wicket-examples/upload/ (the latter URL kinda works, it increments the remaining time but does not track the progress)
>>>
>>> What am I doing wrong
>>>
>>> -Valentin
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Valentin Avksentyev <va...@360works.com>.
The files get uploaded just fine in my app, but no progress is tracked.
It's definitely hard to verify if the progress bar works in the example sites, with a limit of 100k, I haven't tried throttling my upload speed, I guess I should try that next.
-Valentin
On Feb 2, 2011, at 2:20 PM, Michael O'Cleirigh wrote:
> Hello,
>
> Have you looked at the wicket 1.4 examples here: http://wicketstuff.org/wicket14/upload (this is the source into the github mirror: https://github.com/apache/wicket/tree/wicket-1.4.x/wicket-examples)
>
> I tried both and they work to upload I'm not sure on the progress bar as I used a file that was too small and it blinked by.
>
> The upload limit in the 1.4 example is 100k but yours in 1 GB which could be why your upload test is failing.
>
> Regards,
>
> Mike
>> Hi I've been beating my head against the wall with this.
>>
>> I'm overriding newWebRequest in my Application class:
>> @Override
>> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
>> {
>> return new UploadWebRequest(servletRequest);
>> }
>>
>> Here is the code in my upload panel class:
>> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
>> @Override
>> protected void onSubmit() {
>> final FileUpload upload = fileUploadField.getFileUpload();
>> if (upload != null) {
>> try {
>> File newFile = new File(uploadFolder, upload.getClientFileName() );
>> // Save to new file
>> newFile.createNewFile();
>> upload.writeTo(newFile);
>> _processSelection(server, newFile, destFolder);
>> } catch (Exception e) {
>> throw new RuntimeException("Unable to write file");
>> }
>> } else {
>> throw new RuntimeException( "file selected for upload is empty" );
>> }
>> }
>> };
>> uploadform.setMultiPart(true);
>> uploadform.setMaxSize(Bytes.gigabytes(1));
>>
>> uploadform.add(fileUploadField = new FileUploadField("fileInput"));
>> uploadform.add(new UploadProgressBar("progress", uploadform));
>> uploadform.add( new UploadValidator(fileUploadField, prefix) );
>> add( uploadform );
>>
>>
>> This is based on the examples, the examples themselves are not working for me either:
>> I tried, http://wicketstuff.org/wicket13/upload and http://www.wicket-library.com/wicket-examples/upload/ (the latter URL kinda works, it increments the remaining time but does not track the progress)
>>
>> What am I doing wrong
>>
>> -Valentin
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: File upload progress bar
Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
Hello,
Have you looked at the wicket 1.4 examples here:
http://wicketstuff.org/wicket14/upload (this is the source into the
github mirror:
https://github.com/apache/wicket/tree/wicket-1.4.x/wicket-examples)
I tried both and they work to upload I'm not sure on the progress bar as
I used a file that was too small and it blinked by.
The upload limit in the 1.4 example is 100k but yours in 1 GB which
could be why your upload test is failing.
Regards,
Mike
> Hi I've been beating my head against the wall with this.
>
> I'm overriding newWebRequest in my Application class:
> @Override
> protected WebRequest newWebRequest(HttpServletRequest servletRequest)
> {
> return new UploadWebRequest(servletRequest);
> }
>
> Here is the code in my upload panel class:
> Form<Void> uploadform = new Form<Void>("fileUploadForm") {
> @Override
> protected void onSubmit() {
> final FileUpload upload = fileUploadField.getFileUpload();
> if (upload != null) {
> try {
> File newFile = new File(uploadFolder, upload.getClientFileName() );
> // Save to new file
> newFile.createNewFile();
> upload.writeTo(newFile);
> _processSelection(server, newFile, destFolder);
> } catch (Exception e) {
> throw new RuntimeException("Unable to write file");
> }
> } else {
> throw new RuntimeException( "file selected for upload is empty" );
> }
> }
> };
> uploadform.setMultiPart(true);
> uploadform.setMaxSize(Bytes.gigabytes(1));
>
> uploadform.add(fileUploadField = new FileUploadField("fileInput"));
> uploadform.add(new UploadProgressBar("progress", uploadform));
> uploadform.add( new UploadValidator(fileUploadField, prefix) );
> add( uploadform );
>
>
> This is based on the examples, the examples themselves are not working for me either:
> I tried, http://wicketstuff.org/wicket13/upload and http://www.wicket-library.com/wicket-examples/upload/ (the latter URL kinda works, it increments the remaining time but does not track the progress)
>
> What am I doing wrong
>
> -Valentin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org