I got beginners question.
How to save a file stream to a file on server?!
I got this:
var source = Request.QueryString["src"];
WebClient webclient = new WebClient();
using (Stream stream = webclient.OpenRead(source))
{
Bitmap iconbitmap = new Bitmap(System.Drawing.Image.FromStream(stream));
FileStream os = new FileStream("./asdasdasd.ico", FileMode.Create);
var ic = MakeIcon(iconbitmap, 16, false); /// function returns an icon
ic.Save(os);
}
My problem is than when I run code in ASP.NET Development Server it saves "asdasdasd.ico" into: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\asdasdasd.ico
And, when I run it on remote server got error.
I want to save it into: www.my-web-site.com/output/asdasdasd.ico
Thank you very much.