Download Error - File was not marked for prefetch in download pre-pass

In my actionscript, I have prefetch occuring based on a parameter value:

if {parameter "a" = "1"}
prefetch blah1
waithidden __Download\blah
endif

if {parameter "a" = "2"}
prefetch blah2
waithidden __Download\blah
endif

Because my parameters don’t exist at the time the download manager runs, the downloads fail to get to the client and the client gives the error Command failed (File was not marked for prefetch in download pre-pass

I don’t want really want to prefetch both files regardless of the IF because the both downloads have the same filename and I don’t want the client to download them both.

I read that a prefetch block might help, but is there an alternative?

It might depend on what you are using to generate your parameters (and if that method will work in a pre-fetch block.

That said, pre-fetch block is your best, next step.
https://developer.bigfix.com/action-script/guide/

If you fix the relevance to not error if the parameter doesn’t exist that should resolve your problem. Downloads evaluate 2 times, when using prefetch outside of a prefetch block, once prior to running and again when the action runs. This action should work, the downloads will not be pre-cached.

if {(parameter “a” = “1”) | false}
prefetch blah1
waithidden __Download\blah
endif

if {(parameter “a” = “2”) | false}
prefetch blah2
waithidden __Download\blah
endif