• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Cannot open existing attachment

Experts,
       I have lotus notes client system that I need to convert to web and there are existing attachment on the documents created through the client. Problem is that first there is no icon for the attached and second it cannot be opened.
Thanks!
0
aentice
Asked:
aentice
  • 6
  • 6
1 Solution
 
Bill-HansonCommented:
There is probably a hidden field on your form called "$V2AttachmentOptions" that is set to "0".  This is the setting that we use to hide attachments via a web browser.  If that field is there, removing it should allow you to see the attachments on the web.

That said, I still hide mine and provide a better looking interface by using @AttachmentNames and urls cunstructed to target the individual files.

http://Host/Database/View/Document/$File/Filename?OpenElement

See the Designer help topic "URL commands for opening attachments, image files, and OLE objects" for more info on File URLS.
0
 
aenticeAuthor Commented:
I dont have a $V2AttachmentOptions on the document. The attachments already exist, so how can I add @AttaachmentNames without changing or disturbing the attached files.
0
 
Bill-HansonCommented:
The first thing to determine is where the attachments really are stored and how the Notes application is managing them.

(1) They could be attached directly to the NotesDocument is which case, they should display via a browser unless the original programmer hid them.

(2) They could be attached inside a RichText field in the NotesDocument.  This is a bit trickier since the RichText may include hide-formulas.

(3) They could be attached to a related record.

You'll need to interrogate the design of the system to determine exactly where the files are being stored.  I could explain how to use @AttachmentNames to build a better interface, but we need to know where the files reside first.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
aenticeAuthor Commented:
The attachment is attached to the document and is not referenced by any other related-record.
Answer is #2 --- it is a rich text field with no hide formulas.
0
 
Bill-HansonCommented:
Try adding a <Computed Text> element to the form with this code:

dbUrl := "/" + @ReplaceSubstring(@Subset(@DbName;-1);"\\":" ";"/":"%20");
strViewAlias := @ReplaceSubstring(@Subset(@ViewTitle; -1); " "; "%20");
viewName := @If(strViewAlias != ""; strViewAlias;  "$DefaultView");
docUrl := dbUrl + "/" +viewName  + "/" + @Text(@DocumentUniqueID);
"[<a href='" + docUrl + "/$File/" + @AttachmentNames + "'>" + @AttachmentNames + "</a>]"

This should give you links to download the file(s).
0
 
aenticeAuthor Commented:
0
 
Bill-HansonCommented:
My example above creates a relative link, not an absolute one (and therefore does not require a protocol or server to be part of the URL).  Where did the "http://" come from?  That was not in my code.
0
 
aenticeAuthor Commented:
In my document I have this code in the HTML Head content
n1 := @NewLine;
vPath :=@WebDbName;
n1 + "<base href=\"http://" + Server_name + DBPath + "\" />" + n1 + "<META http-equiv=Content-Type content=\"text/html; charset=iso8859-1\">" + n1
This might be the cause, I got this sample from the book.
0
 
Bill-HansonCommented:
I never use base URL addressing.  I don't like hard coding anything, and if you add an ssl certificate to your server later, you're going to have to go back and change all of those "http"s to "https"s.

Also, this code is incomplete.  The vPath variable is never used, and the Server_name and DBPath variables are never defined (that's why there's nothing in between "http://" and "/Additional..." in your URL.  It looks like "vPath" should really be named "DbPath", but there's no getting around defining the Server_name variable (which would also be a hard-coded value so your application would not work across multiple servers).

I would just take that part of the code out of the header unless you have a good reason for using it.  Then start using relative addresses.  A relative address is relative to the server, so you don't have to know the server name.  The url always starts with a "/".  Ex:  "/database/view/document".  Or in our case, "/database/view/document/file".
0
 
aenticeAuthor Commented:
Thank you for your time. It works.
0
 
aenticeAuthor Commented:
One more thing! How can I open this in a new window?
0
 
Bill-HansonCommented:
Just add a target parameter to the anchor tag and set it to "_new".

"[<a href='" + docUrl + "/$File/" + @AttachmentNames + "' target="_new">" + @AttachmentNames + "</a>]"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now