Я предполагаю, что Ваше лучшее решение использовало бы GetThumbnailImage от.NET Изображение класс.
// Example in C#, should be quite alike in ASP.NET
// Assuming filename as the uploaded file
using ( Image bigImage = new Bitmap( filename ) )
{
// Algorithm simplified for purpose of example.
int height = bigImage.Height / 10;
int width = bigImage.Width / 10;
// Now create a thumbnail
using ( Image smallImage = image.GetThumbnailImage( width,
height,
new Image.GetThumbnailImageAbort(Abort), IntPtr.Zero) )
{
smallImage.Save("thumbnail.jpg", ImageFormat.Jpeg);
}
}
Убедитесь, что, например, используете 'get' или 'post' последовательно с вашим вызовом $ .ajax.
$.ajax({
type: 'get',
необходимо встретить с помощью
app.get ('/', function (req, res) {
======= ======== и для поста
$.ajax({ type: 'post',
необходимо встретиться с
app.post('/', function(req, res) {