Hi,
To cut the problem from the source... Do you need to have a file in the
file system?
We are using a DynamicWebResource that answers a PDF directly from memory.
Here some code:
// we have a method that generates the PDF as a byte[]
final byte[] thePDFInBytes = generatePDF();
Resource cResource = new DynamicWebResource() {
protected ResourceState getResourceState() {
return new ResourceState() {
public String getContentType() {
return "application/pdf";
}
public byte[] getData() {
return thePDFInBytes;
}
};
}
};
In fact we must review this idea yet (we are not sure that it will be our
final approach), but it works.
By the way, it would be nice to hear if this is a good idea or not.
Bye,
German
PS: i just subscribed to the list today, sorry if i'm missing something
too obvious.
It seems that Igor Vaynberg wrote:
> your webresource knows when its done streaming data, so just delete it
> there.
>
> -igor
>
> On 7/30/07, John Carlson <[EMAIL PROTECTED]> wrote:
>>
>> I have a dynamically created pdf report that I make available to the
>> user via a ResourceLink. In wicket the file is created as a
>> WebResource. As the report contains sensitive information I want to
>> delete it from the server as soon as it has been downloaded. I couldn't
>> find any 'onDownloadComplete()' type functions associated with either
>> DownloadLink or ResourceLink. I would prefer not to bury the link in a
>> modal window that does provide a onClose callback. Any ideas would be
>> appreciated!
>>
>> john
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]