Board Thread:Wiki Discussion/@comment-35301431-20130617151045/@comment-917693-20140117163707

In that case, I'd use the ifexist function.

Example:

with existing file:

with non existing file:

Source code:

For this though, the parameter would have to be where there's the "file", and in the file field the file name w/o extension (.png/.jpg) should be put. And if neither the file with the file name as png nor as jpg exists, there'll be a link to the upload page, with preset file name (without extension).

Alternatively, the parameter could be just the whole file name with extension, and the template will grab the name without extension off from the file name with extension, and then will check if there are already files of that name added, again checking the extensions png and jpg (and jpeg). If not, it'll lead to the upload page with the file name.

To grab the name without extension an alternation of this can be used:

But actually, if you want a preset name, the uploader would have to stick to yout extension. He cannot e.g. upload jpg when the file stated on the page is png.

Also sorry if what I wrote sounds messy; just saying what came to my mind, and alos sorry for throwing random codes at you.