Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 30, 2012 07:32 AM by RameshRajendran
Member
35 Points
70 Posts
Nov 30, 2012 12:02 AM|LINK
imageSource.Save(Server.MapPath("~/UserImages/" + txtUsernameA.Text + ".jpeg"));
imageSource is a bitmap class variable and thee file doesnt get saved on the server?
It gets stored on development server but not on the server
I am getting this error : A generic error occurred in GDI+
All-Star
154830 Points
19854 Posts
Moderator
MVP
Nov 30, 2012 06:37 AM|LINK
Most often, this error occurs because the user account (NETWORK SERVICE) doesn't have permission to write to the location you are trying to save the file at. You need to apply WRITE permissions to the UserImages folder.
31237 Points
6384 Posts
Nov 30, 2012 06:58 AM|LINK
Create folder called "UserImages" in Server
Try also
imageSource.Save(Server.MapPath("~/UserImages/") + @"\" + txtUsernameA.Text + ".jpeg");
or create the dir if not exist before saving
string spath = Server.MapPath("~/") + @"\UserImages"; if (!System.IO.Directory.Exists(spath)) { System.IO.Directory.CreateDirectory(spath); }
Star
7983 Points
2099 Posts
Nov 30, 2012 07:32 AM|LINK
http://forums.asp.net/t/1280634.aspx/1
http://stackoverflow.com/questions/1796873/how-to-save-web-c-sharp-bitmap-object-to-server-disk
http://stackoverflow.com/questions/1347652/bitmap-save-in-net-is-saving-the-image-in-an-incorrect-format
sly_chandan
Member
35 Points
70 Posts
Saving Bitmap file on server
Nov 30, 2012 12:02 AM|LINK
imageSource.Save(Server.MapPath("~/UserImages/" + txtUsernameA.Text + ".jpeg"));imageSource is a bitmap class variable and thee file doesnt get saved on the server?
It gets stored on development server but not on the server
I am getting this error : A generic error occurred in GDI+
Mikesdotnett...
All-Star
154830 Points
19854 Posts
Moderator
MVP
Re: Saving Bitmap file on server
Nov 30, 2012 06:37 AM|LINK
Most often, this error occurs because the user account (NETWORK SERVICE) doesn't have permission to write to the location you are trying to save the file at. You need to apply WRITE permissions to the UserImages folder.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
oned_gk
All-Star
31237 Points
6384 Posts
Re: Saving Bitmap file on server
Nov 30, 2012 06:58 AM|LINK
Create folder called "UserImages" in Server
Try also
imageSource.Save(Server.MapPath("~/UserImages/") + @"\" + txtUsernameA.Text + ".jpeg");or create the dir if not exist before saving
string spath = Server.MapPath("~/") + @"\UserImages"; if (!System.IO.Directory.Exists(spath)) { System.IO.Directory.CreateDirectory(spath); }RameshRajend...
Star
7983 Points
2099 Posts
Re: Saving Bitmap file on server
Nov 30, 2012 07:32 AM|LINK
http://forums.asp.net/t/1280634.aspx/1
http://stackoverflow.com/questions/1796873/how-to-save-web-c-sharp-bitmap-object-to-server-disk
http://stackoverflow.com/questions/1347652/bitmap-save-in-net-is-saving-the-image-in-an-incorrect-format