Friday, 24 March 2017

c#

<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>

<%

Context.Response.ContentType = "text/plain";

String directory = "/usr/local/tomcat7/webapps/voices/";

String action = Request.QueryString["action"];
HttpRequest request;

String upload = "upload";
String save = "save";
String delete = "delete";

if (upload==action){
 
    Response.Write("uploading file");
    directory += "temp/";
   
   
   
   
}
 else if (save==action) {

     Response.Write("saving file");
   
     String fileName = Request.QueryString["filename"];
     String language = Request.QueryString["language"];
     String mediaLibrary = Request.QueryString["mediaLibrary"];
     String path= directory + language + "/" + mediaLibrary + "/";

     File.Create(path + fileName);

     FileStream fs = File.Create(path + fileName);
   
 }

 else if (delete==action) {

     Response.Write("deleting file");

     if (File.Exists("test.txt"))
     {
         File.Delete("test.txt");
         if (File.Exists("test.txt") == false)
             Response.Write("File deleted...");
     }
     else
         Response.Write("File test.txt does not yet exist!");
   
   
   
   
 }

 

%>
   
   

%>

1 comment:

  1. After reading this blog i very strong in this topics and this blog really helpful to all.Ruby on Rails Online Training

    ReplyDelete