Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
hello friends

i want to know code that allow user only upload three image if he is trying to upload more than three one message show him that you couldn't upload more than three image can you all suggest me code or any reference link please
Posted
Comments
mimtiyaz 13-Mar-13 2:17am    
What tool are you using to upload images, I mean ajax tool, fileupload controls ?
Azziet 13-Mar-13 2:21am    
you can do this by managing a record for image upload limit in database...check uploloaded image count while uploading image...if it >3 then show message
Nandakishore G N 13-Mar-13 2:22am    
refer this tip
http://www.codeproject.com/Tips/531692/Multiple-file-upload-using-jQuery
Atul Rokade 13-Mar-13 2:40am    
azziet sir can u explain me brief.

imtiyaz_mi sir im using normal fileupload control

Hi!!! firstly i will suggest you if want to make restriction to image so whats the problem
give three controls for upload!!!
and on other hand if you save image on data base so make function for it

like
//////////////count image from databse///
C#
if(image count<="3")
{
///your message///
}


check this link

Previewing Image in ASP.NET Image Control using C#[^]
 
Share this answer
 
Comments
Atul Rokade 13-Mar-13 3:24am    
ok shubham sir :)
I hope you know how to upload exactly one file. Something like this:

HTML
<form method="post" .... >

<input name="image1" type="file"> Image #1</input>

</form>


If you add two more input elements in the middle, you will allow the user to upload exactly three. This is the simplest method you can use.

—SA
 
Share this answer
 
Comments
Atul Rokade 13-Mar-13 2:58am    
thank you sir sergey sir your valuable response but i want do this using one fileupload control only ;)
Sergey Alexandrovich Kryukov 13-Mar-13 3:02am    
I don't know why, what's wrong with this simple solution; your case is so simple and yet demanding the limitation, that this simplest solution can be the best for your and the user. You decide, anyway...
—SA
Atul Rokade 13-Mar-13 3:09am    
ya sergey sir, whatever u said it acceptable for my side but client doesn't want that :( :'( that's the problem otherwise your solution is best ..
Sergey Alexandrovich Kryukov 13-Mar-13 3:14am    
I do understand, it can be difficult. Just one note: sometimes a user does not know what they really need, but can be convinced if you provide some good solution and show the prototype. If the user a developer? If not, they don't know the difference between those implementation and might choose whatever is clear and convenient.
—SA
Atul Rokade 13-Mar-13 3:18am    
ok then sir :) i just implement your solution n convinced mad client ;) thank u very much ur support and solution :)

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