       incompleteFileInfo: @__fileInfo()
 
     __fileInfo: =>
+      if @s3Bucket
+        urlBase = "https://#{@s3Bucket}.s3.amazonaws.com/#{@fileId}/#{@sanitizedName}"
+      else
+        urlBase = "#{@settings.cdnBase}/#{@fileId}/"
+
       uuid: @fileId
       name: @fileName
       size: @fileSize
       isStored: @isStored
-      isImage: @isImage
+      isImage: not @s3Bucket and @isImage
       originalImageInfo: @imageInfo
-      originalUrl: if @fileId
-          "#{@settings.cdnBase}/#{@fileId}/"
-        else
-          null
+      originalUrl: if @fileId then urlBase else null
       cdnUrl: if @fileId
-          "#{@settings.cdnBase}/#{@fileId}/#{@cdnUrlModifiers or ''}"
+          "#{urlBase}#{@cdnUrlModifiers or ''}"
         else
           null
       cdnUrlModifiers: @cdnUrlModifiers


    __handleFileData: (data) =>
      @fileName = data.original_filename
      @fileSize = data.size
      @isImage = data.is_image
      @imageInfo = data.image_info
      @isStored = data.is_stored
      if data.default_effects
        @cdnUrlModifiers = "-/" + data.default_effects

      if not @onInfoReady.fired()
        @onInfoReady.fire(@__fileInfo())

    constructor: (@settings) ->
      @fileId = null
      @fileName = null
      @sanitizedName = null
      @fileSize = null
      @isStored = null
      @cdnUrlModifiers = null
      @isImage = null
      @imageInfo = null
      @sourceInfo = null
      @s3Bucket = null

      # this can be exposed in future
      @onInfoReady = $.Callbacks('once memory')
