using RedSocial.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RedSocial.Controllers
{
    public static class Upload
    {
        public static string UploadImage(HttpPostedFileBase file, string route, HttpServerUtilityBase server)
        {
            if (file == null)
            {
                return "";
            }
            string archivo = (DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + file.FileName).ToLower();
            string path = route + archivo;
            file.SaveAs(server.MapPath("~" + path));
            return path;
        }
    }
}