administration mode

 

Mimic the Domino file upload control »

FERDY CHRISTANT - SEP 20, 2004 (05:30:28 PM)

Since the first beta release of this blog template the Resource form has been the black sheep of the family. This form is used to upload files to the blog database, yet it was the only part of the template that was not XHTML-compliant. The reason: file upload controls. when you mark your form as of type text/html, you can't simply place a native file upload control on the form. Instead, you will have to mimic the control using proper HTML. With a little help from Stephan Wissel, I managed to get this working. So if, for whatever obscure reason, you need to mimic file upload controls in Domino, read on. I found some bits and pieces on the net, but nothing that fully explains the process. Here's how I did it:

  • First thing to do is to separate file uploading into two forms, one for the UI, one for the storage. Create a Resource Storage form that holds the file upload controls and other fields you need to store along with the files. Don't forget to add a $$Return field as well. Mark the storage form as Notes, not HTML.
  • Preview the storage form in your web browser. Have a look at the source and drill down to the part where Domino named the file upload controls. You will notice a cryptic name, consisting of the replica id of the database, a Notes unique id, and an offset. For now, the offset is important, write them down for each file upload control you added.
  • Now create a resource UI form and mark it as of type text/html. Use HTML to create your custom form, point the action event to the Resource Storage form and set the form's enctype to multipart/form-data.
  • On the UI form, add HTML tags to generate the file upload controls. Compute the replica id and unique id part, but hardcode the offsets as written down in step 2.
  • On the UI form, add a section to mark existing attachments for deletion. You can do this by imploding the list of values in the reserved field %%Detach.
  • You now have successfully implemented Domino's file upload controls for both new and existing documents using HTML.

The instructions above are rather rough and open to interpretation. Tomorrow I will try to launch v0.90 of the s3maphor3 blog template in which all this is implemented, you can get the full details then. Next on the agenda is a XHTML-compliant search. Any ideas, besides using a print agent?

Comments: 3
Reviews: 1
Average rating: rating
Highest rating: 4
Lowest rating: 4

COMMENT: LAURENS

SEP 20, 22:38:23

comment » Great!!!

This has always been on of the problems. Especially when you have a view with a main document and it's comments, like this page I am currently typing on. It is not possible to put a file upload control in a view that generates HTML, but now it is!!!!!!!

Wow. My compliments. I am surprised how you keep on pushing OVER the limits of Notes. «

COMMENT: FERDY CHRISTANT email

SEP 21, 13:00:51

comment » Ty Ty «

COMMENT: INGO BEYER emailrating

SEP 21, 17:34:34

comment » Do you know this.

http://www-10.lotus.com/ldd/today.nsf/Lookup/e-commerce_1

The search is pretty cool...

Cool site

Ingo «

RATE THIS CONTENT (OPTIONAL)
Was this document useful to you?
 
rating Awesome
rating Good
rating Average
rating Poor
rating Useless
CREATE A NEW COMMENT
required field
required field HTML is not allowed. Hyperlinks will automatically be converted.
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30