Help needed with File Upload Control

Hi all,

I’ve been having a go at this for a while now, but I can’t seem to find the way to make this work. I want to be able to upload a file through a form on the web; simple enough.

I have a form wich I display with a OpenForm type URL. On this form I have embedded the Notes FileUploadControl. I have an agent triggered on Submit of the form which should take the attached file from the context document and do something with it such as attaching it to another document in my Notes database.

When I see my form on the web, I see the browse button with the associated field. I can select a file and I see it’s name in the field. However, when the document is submitted and my agent triggered, the context document doesn’t seem to have any file attachment.

I’ve read several posts on the subject in this forum (there aren’t that many to begin with). I’ve tried examples from Lotus Sandbox (not many there either). I can’t seem to make this work. I used to be a pretty good Notes developper but it’s been a while since I’ve done real Notes development.

Can anybody indicate ALL the steps that need to be done for this to work. Ideally, I would need to allow for multiple file attachments, but I’ll be very happy if I succeed with just the one.

Thanks in advance and be charitable with it being nearly Christmas and all :wink:

Subject: Help needed with File Upload Control

Well, you are now talking about one of my most favourite (or, in some cases, most hated) features/concepts in Domino - file attachments.

Believe me, I have tried several times in the past to do similar things that you are trying, but have “hit the wall” head on in frustration.

In short, a WQS-agent will not have access to the file attachment, since Domino hasn’t really attached the file yet.

As far as I understand, the WQS-agent ‘comes in’ before Domino has decided to actually attach the file.

Occasionally (and this seems to be very randomly) I have managed to get a hold of the attachment using the Evaluate function with the @AttachmentNames function;

vEval = Evaluate(“@AttachmentNames”, docContext)

If this works, well then Bob’s your uncle.

However, most times this seems to not work, and I have been forced to use other means.

The solution is to let the WQS-agent return a URL to yet another agent.

The WQS-agent would then end with something like:

Print |server/db/agent?openagent|

That way, Domino will consider the work of the WQS-agent ‘done’, properly save the attachment, and when you next come in, your attachment is there for you.

Your main problem here is to figure out where to go after the 2nd agent has finished processing. You will need to pass parameters in the URL to that 2nd agent.

This is of course a very cludgy solution as it means an extra round-trip between the server and the browser.

But if that is what you need to get it to work…

Hope this has helped you some.

Ken, http://www.noteshound.com

Subject: RE: Help needed with File Upload Control

Hi,

I have an example on my blog about using the INotes FileUpload control in your domino apps ( the activex control that you get in Inotes web access ).

If you think this avenue is worth the effort then check it out here :

http://thehojusaram.blogspot.com/2006/09/domino-activex-inotes-file-upload.html

The Inotes Control supports multiple fileuploads , drag and drop and a Windows explorer type interface in the browser.

My solution does require a re-compile of a java servlet so it might not be worth the effort, but it may help.

Merry Christmas.

Subject: RE: Help needed with File Upload Control

Thanks for your quick responses Kenneth and Simon. I will try both your solutions during the holidays between the turkey and the apple pie. I’ll post again in january to let everybody know how it turned out.