Во всяком случае, я просто погуглил о функциях php, написал это в asp.net и хотел добавить сюда. Это может быть полезно для тех, кто просто хочет добавить плагин загрузки изображений для markitup и применить его в asp.net
try
{
string filePath = "/var/www/vhosts/test/htdocs/uploads/";
if (Request.Files.Count <= 0)
{
Response.Write("Please select an image to upload");
}
else
{
for (int i = 0; i < Request.Files.Count; ++i)
{
HttpPostedFile file = Request.Files[i];
file.SaveAs(Server.MapPath(filePath + file.FileName));
Response.Write("{\"Uploaded FileName\":\"" + file.FileName + "\"}");
// option to use System.IO fileinfo to get file information
// FileInfo fileInfo = new FileInfo....
// option to add an array to return file info + path etc..
}
}
}
catch (Exception ex)
{
Response.Write("{\"error\": \"" + ex.Message +"\"}");
}