placeholder for Upload directory always use the raw value ?

lcollong

FabriKant d'applications web
Hi,

Using the fileupload element with an upload Directory set this way : /images/upload/{mytable___fk_country}
where the placeholder fk_country is a dbjoin element displaying the country.
my goal is to have an upload directory for each country.
the result is directories like /images/upload/1/, /images/upload/2/, etc... where 1 and 2 are actually the index of the given country. As if I were set : /images/upload/{mytable___fk_country_raw}

Any chance to have the result being /images/upload/France, /images/upload/Spain, etc... ?
 
Hi
Sorry as we are replacing here with the posted form data we don't have direct access to the label data. Changing it would also produce backwards compatibility issues for people,

-Rob
 
Thanks Rob,

I'll create a calc element to store the country's name and use it for the upload directory path.
 
I was about to suggest that.

The only thing to watch for is if you have pre-existing data. I'm not 100% sure even setting "calc on save only" to "no" (so it calcs on render as well) would always work when an upload element is being displayed. So you may have to manually set any pre-existing data so the calc has a value in the database.

-- hugh
 
Good point, as the file is usually catched on row creation. In this particular case, country is linked to current user so I'm always able to find a reasonable default value that I can apply using a form plugin (onBeforeLoad ?). I'll do some test...
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top