Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want code in asp .net c# to upload only jpg file and size 20 kb..

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 13-May-13 2:13am
v2
Comments
OriginalGriff 13-May-13 8:14am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

I'm giving an example to store an image in database.Use this

suppose an insert function
C#
insertfunction(byte[] buffer);


to insert a pic.
C#
int l=uploadPhoto.PostedFile.ContentLength; 
        byte[] pic= new byte[l];
        uploadPhoto.PostedFile.InputStream.Read(pic,0,l);
        string typ = uploadPhoto.PostedFile.ContentType;
insertfunction(pic); //passing the picture buffer


any doubt plz ask
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900