Need help in Attachments

Hi,I am creating notes document through a web form…My problem is with attachments.I am allowing users to attach attachments using fileupload control.

I want these attachment to go in a specific feild in Notes document.and it is not allowed to extract it in server and deattach it.

I have used code to copy all $File to notesdocument.So all attachments will come in bottom…

Then i have used code in Queryopen of notesdocument to extract it in client machine then again attach it to specific field using following code…

If doc.HasItem("$File") Then

			Dim rtItem As NotesRichTextItem

			Dim inputAttachment As NotesEmbeddedObject

			Dim filePath As String

			Dim moveToFieldName As String

			Dim vEval As Variant

			vEval = Evaluate("@AttachmentNames", doc)

			Forall v In vEval

				Set inputAttachment = doc.GetAttachment ( v )

				filePath = "c:\"+ v

				Call inputAttachment.ExtractFile(filePath)

				If doc.HasItem("SupportAttach") Then

					Set rtItem = doc.GetFirstItem ( "SupportAttach" )

				Else

					Set rtItem = New NotesRichTextItem ( doc, "SupportAttach")

				End If

				Set inputAttachment = rtItem.EmbedObject ( EMBED_ATTACHMENT, "", FilePath )

				Kill FilePath

			End Forall

My problem is i am not able to delete the attachment that is bottom…if i use doc.remove(“$File”),it will delete attachment in field also…

Can any one help?

Cheers

Merrin

Subject: Need help in Attachments

Hi,

“I want these attachment to go in a specific feild in Notes document”

This is not possible on web :frowning:

Attachments will be always on the bottom of document , so, the only way to improved that, is to hidden attachment at the bottom and create a links to these attachments where you want , take a look at this Hiding attachments (without noscript tag!) - Article - CodeStore

(The exellent Jake Howlett’s site “codestore.net”)

Also here Control how attachments are removed - Article - CodeStore (with demo database available) you can control how attachments are removed.

and in “codestore.net” search for “attachment” there is other articles very useful…

and take a look in “sandbox” in this forum (at the right) I remember that there are managment tools for attachments for the web applications.

HTH

Thierry

Subject: RE: Need help in Attachments

No, you can move attachments in a WebQuery agent. After extracting the file to the filesystem, one needs to remove the attachment (NotesEmbeddedObject.Remove) and save the document, then re-create the attachment in the rich text field.

Subject: RE: Need help in Attachments

Thank you Stan.It worked…

Cheers

Merrin