Tags:
create new tag
view all tags

SID-00473: How can I determine if a given attachment exists or not?

Status: Answered Answered TWiki version: 4.0.3 Perl version: 5.x
Category: CategoryAttachments Server OS: RedHat Linux Last update: 16 years ago

It is quite straight forward to see if a given topic exists.

 %IF{"istopic 'topicname'" then="present" else "not present"}%

However if topicname is changed for topicname?filename=myfile then this doesn't work as it always returns true (yes the topic exists) altering topicname to be fullurltotopic?filename=myfile does not work either.

How can I programmatically detect whether an attachment exists or not.

BTW I'm not looking for a %SEARCH solution as I'm trying to create an in-line URL link to either link to the appropriate file or to enable a pop-up warning functionality.

-- JeremyWolstenCroft - 2009-08-11

Discussion and Answer

I think you may need a %SEARCH% solution for this: QuerySearch can get you the attachment information you need.

Then the SpreadSheetPlugin can be used to evaluate the search result, and generate in-line URL or tag with the javascript pop-up. See, "Can I use CALC in a formatted search?" in the plugin's documentation.

-- SeanCMorgan - 2009-08-13

Seems to be answered.

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2009-10-02

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title How can I determine if a given attachment exists or not?
SupportCategory CategoryAttachments
TWiki version 4.0.3
Server OS RedHat Linux
Web server Apache
Perl version 5.x
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2009-10-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.