File.PostedFile

  • Thread starter Thread starter vips
  • Start date Start date
V

vips

I am using asp.net (VB)
for uploading the files on my server I am using
input type file (runat=server)

my code is
If ( FileProductImage.PostedFile.ContentLength > 0 ) Then

strurl = "c:\images\image1.jpg"

FileProductImage.PostedFile.SaveAs(strurl)

End If

-------

I am getting error on the first line

(FileProductImage.PostedFile) doesnt give error

( FileProductImage.PostedFile.ContentLength ) gives error -- Object
reference not found.

why do I get this errror only on implementation server & not on development
server.

it works fine on development server .

help please.
 
vips said:
I am using asp.net (VB)
for uploading the files on my server I am using
input type file (runat=server)

my code is
If ( FileProductImage.PostedFile.ContentLength > 0 ) Then

strurl = "c:\images\image1.jpg"

FileProductImage.PostedFile.SaveAs(strurl)

End If

-------

I am getting error on the first line

(FileProductImage.PostedFile) doesnt give error

( FileProductImage.PostedFile.ContentLength ) gives error -- Object
reference not found.

That means PostedFile is null (i.e. Nothing)?
why do I get this errror only on implementation server & not on
development server.

it works fine on development server .

Can you check the posted HTTP requests to see whether it still contains
the posted file when it arrives at the web application server?

Cheers,
 
IsNothing(FileProductImage) --> false

IsNothing(FileProductImage.PostedFile) --> true



what could be the reason ...are any dll missing ?
 
Back
Top