                 else if photo?.binary.file?
                     type = 'file'
                 else
+                    # There is nothing to download for this photo.
                     return cb()
 
-                name = photo.title or "#{photo.id}.jpg"
+                # Get a stream  of the binary.
                 laterStream = photo.getBinary type, (err) ->
                     if err?
                         log.error "An error occured while adding a photo to

                res.setHeader 'Content-Disposition', disposition
                res.setHeader 'Content-Type', 'application/zip'

                async.eachSeries photos, addToArchive, (err) ->
                    if err
                        log.error "An error occured: #{err}"
                    else
                        archive.finalize()



                # Start the streaming.
                archive.pipe res

                # Abort archiving process when the user aborts his request.
                res.on 'close', ->
                    archive.abort()

