PLEASE, if anyone has figured out the secret formula for getting this thing to work correctly, please let me know. I’ve wasted hours upon hours trying this and that and it never works as I desire.
Basically, I have a web app that is also doing double duty as a Notes client app. I have a main form that has a computed subform. One subform is for the web and contains all that browser related UI stuff, and a client subform with the same fields but done for the Notes client functionality.
We have the temp directory set up on the server, which I found in a separate posting on this forum.
On my subform for the web I have a file upload control (although I actually need to have 4 total). Here’s where it gets weird. The control seems to save the file to the first available richtext field on the form. To try to be clever, and since I didn’t want the files attaching to my Comments field, I created another RTF directly after the upload control. However, I don’t want it to display on the screen, since it has no purpose. So I tried to hide it. That didn’t work. The files would just go into the next richtext field, not the one I set up for that purpose. So I tried to hide it but make it available in the source by doing this:
The reason is because if I just hide it, it will not let you put in your own rows,cols attributes. It ignores anything you put in there and makes it like 7 and 50, respectively.
Now the attachments are saved as $FILE fields on the form, but still display in the 2nd richtext field after the upload control.
This is the kludgiest thing I’ve seen in years. What in the world is the trick to making this work? I do want to have to resort to double submits and all that nonsense.
I cannot purchase anything, so please no responses from vendors offering commercial solutions.
Subject: File Upload Control - is this the most whack thing or what?
You may be misinterpreting what you’re seeing. When you use a file upload control to attach a file to a document, it’s not being saved to a given RTF; perhaps it appears that way to you because the file icon is showing up at the bottom of the document near your rich text field. Instead, however, it’s attached at the document level, not to a field.
Moreover, when you get into the document properties, all attachments are really stored in the $File item, whether they’re attached to an RTF or not (the RTF actually contains a pointer to the appropriate file in $File), so what you’re seeing isn’t unexpected.
Subject: RE: File Upload Control - is this the most whack thing or what?
I understand what you are saying, but on the Notes client document display the files are placed inside the first visible RTF file after they are submitted from a web page, regardless of how they might be actually stored. When I post from the web, then open the same doc back in Notes, there they are…appended to the end of the text of the RTF field…and the wrong RTF one at that.
Basically, I have had to remove all RTFs from the form (which blows), which then puts all attachments in some weird place at the bottom of the document below what looks like a page break line. So I’ve lost the impressive comments fields I had as Java applets and now have just text fields. This really should be cut and dry, but it’s not, and it’s poorly documented as well.
Anyway, if I had time I’d try the idea of creating attachment documents that are children of the main doc (as suggested by another responder), but I’m under a deadline and haven’t the luxury of experimentation at this point.
Subject: RE: File Upload Control - is this the most whack thing or what?
RT is definitely whacked. I reported an SPR awhile back (you can search for it in this forum if you want) where, if your DB was using the property “Display images after loading”, then merely getting a handle on an RT item in script that had an image would cause the image to be moved to the $File item.
There’s obviously some aaaaaaaancient RT legacy code that has to hang around version-to-version for backwards compatibility, and some of it does some really weird stuff.
I know you said you can’t purchase a commercial product for this particular case, but if you’re needing to do serious RT work down-the-road I would strongly recommend Ben Langhinrichs’ Midas Rich Text product. I’d say that for most people it pays for itself in the first day of use.
Subject: RE: File Upload Control - is this the most whack thing or what?
Looks like you might be better off processing via web query save and extract the attachements to disk, delete them from the notes doc and then embed them back into your RTF fields.
Subject: RE: File Upload Control - is this the most whack thing or what?
It’s not that File Upload Controls are necessarily whacked, but Notes’ rich text (and more specifically, attachment management) in-general.
You might want to explore storing attachments as separate documents, and linking them to your main doc. This limits some of your native-to-the-main-doc functionality (e.g. @AttachmentNames) but you can get around most of that with @DbLookups, script, embedded views, etc.
By having one attachment per doc you can get much finer control over what the heck you do/don’t want done with your files, especially in a mixed-mode environment.