Esempio n. 1
0
 public ActionResult Upload(HttpPostedFileBase file, string path, string[] args)
 {
     if (args.Length > 0)
     {
         var blob = new BlobFile2(User.Identity.Name, path + args[0]);
         if (blob.Exists()) return Error("File \"" + args[0] + "\" already exists.");
         try
         {
             blob.CreateFile(file.InputStream);
             return SuccessWrapper("Upload successfully");
         }
         catch (Exception ex)
         {
             return Error("Upload file failed");
         }
     }
     return Error("Usage: upload [filename]");
 }