Esempio n. 1
0
        public virtual ActionResult UploadFacebookAlbumPhotos(string id, string albumId, IEnumerable<string> photosUrls)
        {
            var requestedEvent = _es.FindBySlug(id);

            //ToDo: Move queues names into Epilogger.Common
            using (var messageProducer = new MQ.MSGProducer("Epilogger", "FacebookImage"))
            {
                foreach (var photoUrl in photosUrls)
                {
                    var facebookImageMsg = new MQ.Messages.FacebookImageMSG(requestedEvent.ID, albumId, new Uri(photoUrl), CurrentUserID);
                    messageProducer.SendMessage(facebookImageMsg);
                }
            }

            return new EmptyResult();
        }
Esempio n. 2
0
        public virtual ActionResult UploadFromComputer(string id, IEnumerable<HttpPostedFileBase> files)
        {
            var requestedEvent = _es.FindBySlug(id);

            //ToDo: Move queues names into Epilogger.Common
            using (var messageProducer = new MQ.MSGProducer("Epilogger", "FileImage"))
            {
                foreach (var fileKey in Request.Files.AllKeys)
                {
                    var file = Request.Files[fileKey];

                    var fileMemoryStream = new MemoryStream();
                    file.InputStream.CopyTo(fileMemoryStream);

                    var imageMessage = new MQ.Messages.FileImageMSG(requestedEvent.ID, null, fileMemoryStream.ToArray(), file.FileName);
                    messageProducer.SendMessage(imageMessage);
                }
            }

            return new EmptyResult();
        }