Posted on: 7/24/2013 3:39:17 AM | Views : 226

I'm trying to upload my image into the database via memorystream. I'm able to uplaod the image successfully into the database. I have also added a RegularExpressvalidator to check if a particular image format is being received. However, when i uploaded a correct image format(jpg) the error message from my regularexpressvalidator still appear.
I have 5 different file upload each with a different regularexpressvalidator like this
<asp:FileUpload ID="FileUpload1" runat="server" style="margin-left: 25px" /> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="FileUpload1" Runat="Server" ErrorMessage="Only jpg files are allowed" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG)$"/>


I have a button called btnReport which handles all the image uploading like this Go to the complete details ...