C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Images »

Images upload to server


Posted Date: 22 Aug 2008    Resource Type: Code Snippets    Category: Images
Author: amit chaudharyMember Level: Gold    
Rating: 1 out of 5Points: 10



This code will help us to upload images to server.

on design page add a fileupload control and a button.

on button click:-

{
string fp;
fp = fileImgUpload.PostedFile.FileName ;
string fn;
fn = TextBox1.Text + "_" + TextBox2.Text + "_" + fp.Substring(fp.LastIndexOf("\\") + 1); // TextBox1 and TextBox2 is for image name(if we want to add some image name)
string sp;
sp = Server.MapPath("photo_contest");
if (sp.EndsWith("\\") == false)
{
sp += "\\";
}
sp += fn;
fileImgUpload.SaveAs(sp);
}




Responses

Author: rangasamy    15 Oct 2009Member Level: Bronze   Points : 0



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Images uploading to server  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Image uploading to database
Previous Resource: How To Insert Image Into Database
Return to Discussion Resource Index
Post New Resource
Category: Images


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use