Re: No Instance Availabe error on download
Re: No Instance Availabe error on download
- Subject: Re: No Instance Availabe error on download
- From: Stefan Klein <email@hidden>
- Date: Thu, 04 Mar 2010 09:01:40 +0100
Hi Fred,
for large downloads I use this:
@Override
public void appendToResponse(WOResponse aResponse, WOContext
aContext)
{
...
aResponse.disableClientCaching();
aResponse.removeHeadersForKey("Cache-Control");
aResponse.removeHeadersForKey("pragma");
aResponse.setHeader("inline; filename=" +
NSPathUtilities.lastPathComponent(_filename), "content-disposition");
aResponse.setHeader(useContentType, "content-type");
aResponse.setHeader(NSPathUtilities.lastPathComponent(_filename),
"content-name");
_asStream(aResponse);
}
private void _asStream(WOResponse aResponse)
{
try
{
File f = new File(getFilename());
int bufferSize = (f.length() < 1024 * 1024) ? (int)
f.length() : 1024 * 1024;
aResponse.setContentStream(new FileInputStream(f),
bufferSize, f.length());
}
catch (FileNotFoundException e)
{
...
}
}
Stefan
Am 03.03.10 23:54, schrieb Fred Wells:
No, I am not maybe I'm missing
something
but isn't my problem in the response not the request?
thanks.
-fw
are you using the streaming request handler ?
On 3 March 2010 22:24, Fred Wells <email@hidden>
wrote:
>
> Hello,
> I'm not sure if I missed something, I can't seem to find anything
on this
> but I can't get files larger than a few MBs to download. I am
currently
> using
> WOResponse.setContentStream and right now with a 29MB file it
falls
under a
> 'No Instance Available' error. Is this broken or is there an
alternative?
> I'm using 5.3 on IIS.
>
> Thanks.
> -fred
>
>
------------------------------------------------------------------------
> Disclaimer
> The information in this email and any attachments may contain
proprietary
> and confidential information that is intended for the addressee(s)
only. If
> you are not the intended recipient, you are hereby notified that
any
> disclosure, copying, distribution, retention or use of the
contents
of this
> information is prohibited. When addressed to our clients or
vendors,
any
> information contained in this e-mail or any attachments is subject
to the
> terms and conditions in any governing contract. If you have
received
this
> e-mail in error, please immediately contact the sender and delete
the
> e-mail.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>
------------------------------------------------------------------------
Disclaimer
The information in this email and any attachments may contain
proprietary and confidential information that is intended for the
addressee(s) only. If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution, retention
or use of the contents of this information is prohibited. When
addressed to our clients or vendors, any information contained in this
e-mail or any attachments is subject to the terms and conditions in any
governing contract. If you have received this e-mail in error, please
immediately contact the sender and delete the e-mail.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden