-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubmitCameraReport.ashx
More file actions
executable file
·43 lines (34 loc) · 1.07 KB
/
Copy pathSubmitCameraReport.ashx
File metadata and controls
executable file
·43 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<%@ WebHandler Language="C#" Class="myGenericHandler" %>
using System;
using System.IO;
using System.Net;
using System.Web;
public class myGenericHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
try
{
string input = new StreamReader(context.Request.InputStream).ReadToEnd();
context.Response.Write("input=" + input + "\n");
string path = HttpContext.Current.Server.MapPath("/UploadedFiles\\");
//context.Response.Write("MapPath=" + path + "\n");
StreamWriter fp = File.CreateText(path + "Camera-" + Guid.NewGuid().ToString() + ".txt");
fp.WriteLine(input);
fp.Close();
context.Response.Write("Success!");
}
catch (Exception ex)
{
context.Response.Write("Error :" + ex.Message);
}
}
public bool IsReusable
{
get
{
return false;
}
}
}