7 users online. Create an account or sign in to join them.Users

Search

A new extension, "Reflected file upload" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

I added an extension: The Reflected File Upload field

This extension is a variation of the 'Unique Upload Field' extension by Michael Eichelsdoerfer and the Reflection field by Rowan Lewis.

This field enables you to specify the naming expression using reflection:

{entry/field-1}-{entry/field-2}-{entry/@id}

When uniqueness is important you can enable the "Always create unique name" option. This will add "Unique Upload Field" behavior by appending a unique token to the filename.

[Installation]

  1. Upload the 'reflecteduploadfield' folder in this archive to your Symphony 'extensions' folder.

  2. Enable it by selecting the "Field: Reflected File Upload", choose Enable from the with-selected menu, then click Apply.

  3. You can now add the "Reflected File Upload" field to your sections.

Please report issues and stuff in the issue tracker!

Ah nice, so you could create 'friendly' filenames while ensuring they remain unique?

@davidhund Yes, Although the uniqueness is still a 13 character uniqid() appended to the file.

Another way to keep names unique is to use the entry id in the expression. This creates possible issues when there are 2 reflectedupload fields with the same expression in the same section... not that i can think of a situation where that might be needed.

Sure, so: what exactly is the use-case of this field? In other words, apart from the aesthetics, why would I need such a specific filename?

I had a case where website visitors could upload files that belonged to some kind of dossier.

To prevent a complete mess in the upload folder, i used this field to name the file as [dossier_reference]-[client]-[id]

It made it easier to find the correct files for a dossier and, since i am packaging those files so my client can download those files, they have a better chance of finding what they need.

Apart from that there could be SEO advantages (never trust a client to use sensible filenames).

And yes, aesthetics, a not to be underestimated advantage imho ;-)

why would I need such a specific filename?

From a Digital Asset Management point of view, this is a great idea. Storing files with thier original name isn't a useful way of doing things for DAM, ut having the filename unique and dynamic to the entry details is really useful for DAM.

Would it be difficult for you to add the ability to add the files to a folder with the name of the section, or a specified folder name?

@Zimmen - genius! Nice work!

@designermonkey that should be possible. The way a folder is specified in the default file upload field already makes it possible to choose a folder for a section, you just have to create it yourself first and then select it from the pulldown.

Creating a folder based on another field in an entry might be useful, like a category field, files get uploaded into that folder then.

@bzerangue thanks!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details