         @props.valueLink.requestChange files
 
     displayFile: (file) ->
-        suffix = '?download=1'
-        if file.url
-            window.open file.url + suffix
-        else if file.rawFileObject
-            window.open URL.createObjectURL(file.rawFileObject) + suffix
+        if (url = getFileURL file) window.open url + '?download=1'
         else console.log "broken file : ", file
 
     render: ->

            #         @setState {files: currentFiles }




module.exports = FilePicker


    render: ->
        file = @props.file
        unless getFileURL file
            window.cozyMails.log(new Error "Wrong file #{JSON.stringify(file)}")
            file.url = "message/#{@props.messageID}/attachments/#{file.generatedFileName}"
        type = MessageUtils.getAttachmentType file.contentType
