Click here to Skip to main content
11,935,053 members (55,347 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL-server-2005 ASP.NET , +
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 12-Mar-13 21:14pm
Imtiyaz_mi 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
Nandakishorerao 13-Mar-13 2:22am
refer this tip
Atul Rokade 13-Mar-13 2:40am
azziet sir can u explain me brief.

imtiyaz_mi sir im using normal fileupload control
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

//////////////count image from databse///
if(image count<="3")
///your message///

check this link

Previewing Image in ASP.NET Image Control using C#[^]
Atul Rokade 13-Mar-13 3:24am
ok shubham sir :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I hope you know how to upload exactly one file. Something like this:

<form method="post" .... >
<input name="image1" type="file"> Image #1</input>

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.

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 ;)
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...
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 ..
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.
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 :)
Sergey Alexandrovich Kryukov 13-Mar-13 11:30am
What you say sounds really impressive, my congratulation.
It's a great pleasure to help such people who actually can understand things and make things happen.
Then please accept my answer formally (green button). You can accept any number of answers.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 13 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100