Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

AjaxFileUpload get stream Error

$
0
0

hello to all,

i use AjaxFileUpload and i want get stream and change image size and save this to another folder address , my code is :

                        AjaxFileUploader.SaveAs(Server.MapPath("~/Uploades/Product/" + e.FileName));

                        int width = 120;
                        int height = 120;

                        System.IO.Stream stream = e.GetStreamContents();

                        System.Drawing.Bitmap image = new System.Drawing.Bitmap(stream);

                        System.Drawing.Bitmap target = new System.Drawing.Bitmap(width, height);
                        System.Drawing.Graphics graphic = System.Drawing.Graphics.FromImage(target);

                        graphic.DrawImage(image, 0, 0, width, height);
                        target.Save(Server.MapPath("~\\Uploades\\AjaxFileUpload\\ProductThumbImg\\" + e.FileName));
                        target.Dispose();

but in 

   System.IO.Stream stream = e.GetStreamContents();

line code , i get this error:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\SadeQ\AppData\Local\Temp\_AjaxFileUpload\AF2442D8-C572-FE91-9ED5-933F0D337131\1 (2).jpg

i do'nt know why not found address,

what should i do?

please help me


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>