Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am using asp.net,vb.net and vs2008.

I want to browse image file (.jpg) using file upload control.
I am getting this type of error "Parameter is not valid"

my code in below

Dim selected_image As System.Drawing.Bitmap
SQL
If FileUpload1.PostedFile.FileName <> "" Then


                        in_file = FileUpload1.PostedFile.FileName 
                        selected_image = New System.Drawing.Bitmap(in_file)
                        property_ids = selected_image.PropertyIdList

                    End If


i am getting error in this line of code
selected_image = New System.Drawing.Bitmap(in_file)

plz help

Regards
mukesh
Posted
Updated 24-May-12 21:46pm
v2

1 solution

Perhaps you should add another line of code:
VB
If FileUpload1.PostedFile.FileName <> "" Then
    in_file = FileUpload1.PostedFile.FileName ' **** ADD THIS
    selected_image = New System.Drawing.Bitmap(in_file)
 
Share this answer
 
Comments
mukesh_panth 25-May-12 4:22am    
Hi,

Try this code but problem not solve........
I have used this code
If FileUpload1.PostedFile.FileName <> "" Then

in_file = FileUpload1.PostedFile.FileName ' **** ADD THIS
selected_image = New System.Drawing.Bitmap(in_file)
property_ids = selected_image.PropertyIdList

End If

One thing this code is succesfully running in window form.

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

  Print Answers RSS


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