S3 url

Archived from the Transloadit support forum. Originally posted on May 18, 2011; details may be outdated, see our docs for current behavior. Original thread

Hi,

I’m trying to figure out the pattern for the S3 urls and what is written in the docs about it doesn’t seem to match the test uploads I’ve done. In particular, it’s the file.url_name placeholder variable that I’m struggling with.

I uploaded a file with a name “04 - Radiohead - Weird Fishes_Arpeggi.mp3” and this appeared on S3 as “04–Radiohead-WeirdFishes_Arpeggi.mp3”.

Spaces are supposed to be replaced by dashes except it seems that one of the spaces wasn’t, the one between Weird and Fishes.

Is this expected behaviour?

thanks
Felix

Spaces are supposed to be replaced by dashes except it seems that one of the spaces wasn’t, the one between Weird and Fishes.

I don’t see a space in "04--Radiohead-WeirdFishes_Arpeggi.mp3", but if you can point me to an assembly id where the problem occurred, I will have a look.

Assembly id REDACTED

The original file name was 04 - Radiohead - Weird Fishes_Arpeggi

The removal of spaces didn’t seem to be consistent. If you can shed light onto this that would mean we can start using the service live.

Thanks.

Just to clarify the problem…

the original file name was
“04 - Radiohead - Weird Fishes_Arpeggi”

Based on the explanation that spaces are replaced by dashes, the url I expect from this is…
“04—Radiohead—Weird-Fishes_Arpeggi”

However the actual one created on S3 is this…
“04–Radiohead-WeirdFishes_Arpeggi.mp3”

Could you explain the regex that creates this please so we can use it to recreate the url?

thanks

As per our discussion in Skype, the problem was that only the first space was replaced with a dash, all others were removed. This should be fixed now.