Default Upload Location needs matrix field and entry info... How? I have a towns entry with a matrix field: townAlbums.

This matrix field has just one block type: photoAlbum.

This one block type has two basic text fields (the important one being albumName and one asset field for uploading images to the gallery: albumPhotos.

I want the Default Upload Location for this matrix subfield albumPhotos to be dynamic, taking both the parent entry slug (slug of the town entry) and the name of the album: albumName. I'm not sure how to accomplish this.

Desired url:

http://sitename.com/uploads/towns/town-slug/album-name/filename.jpg

What should I be entering for my Default Upload Location?

Thanks!
If your desired URL is:

http://sitename.com/uploads/towns/town-slug/album-name/filename.jpg


The the "Upload Location" for the setup you described would be something like:

towns/{owner.slug}/{albumName}/


I'm assuming towns is just hard-coded since you're referencing town-slug in the next segment.