TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
prathyusha
NA
180
74.7k
fileuploadcontrol
Jun 26 2013 6:39 AM
hi,
by using below this code
if (FileUpload1.HasFile)
{
string savePath = Server.MapPath("~/memberspic/");
string fileName = FileUpload1.FileName;
string pathToCheck = savePath + fileName;
Random rm = new Random();
TextBox txtpass = new TextBox();
txtpass.Text = rm.Next(257871, 498371).ToString();
Guid g = Guid.NewGuid();
string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(Server.MapPath("~/memberspic/") + "img_pk" + txtpass.Text.ToString() + extension);
string te;
te = "~/memberspic/" + "img_pk" + txtpass.Text.ToString() + extension;
impath = pathToCheck;
cmd.Parameters.AddWithValue("@ProfilePicture", te);
}
we can save the image files in folder with this path like ~/memberspic/img_pk368811.jpg but the file size is very large.
how to compress that image file before save to folder.
please help me
it's very important to me.
Reply
Answers (
11
)
how to insert text file data into database
Import Ascii File to Datagridview