473,473 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File.PostedFile

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.


Nov 19 '05 #1
2 2920
vips wrote:
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,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2
IsNothing(FileProductImage) --> false

IsNothing(FileProductImage.PostedFile) --> true

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

"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
vips wrote:
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,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Duy Nguyen | last post by:
how can I save an image file to database?
3
by: moondaddy | last post by:
I have a simple webform where a user can upload images by using an input element of type "file". In the a button's click event in the codebehind is this code which saves the file to the server. ...
4
by: David Elliott | last post by:
I have a need to send a file via a POST and am looking for some information. As an example: A user will be displayed an ASPX page -- The user will select a file. -- The file will then be...
0
by: Benjamin Bittner | last post by:
Hallo NG, ive searched a lot in some google groups, and found many threads, but nothing that helped me. Here is the scenario: I have an aspx page which loads a user control in page.onInit like...
1
by: JenHu | last post by:
Hi experts, I want to create a new empty text file after I upload a file to the desination. Then I need to read each line from the uploaded file and write the lines which first character <>'6'...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
0
by: Daniel | last post by:
Hi, I have trouble in downloading the excel file from sql database. After downloading, i try to open it, the error msg prompt:"The file in not in a recognizable format" Any ideas? i already...
1
by: John | last post by:
Dear, We have 2 IIS server on win2000. we use the web server for upload file from server1 IIS to server2 IIS. We can connect from IIS1 to IIS2 success but the file unable to upload with below...
0
by: pbd22 | last post by:
Hi. I am having a really tough time here and would appreciate some help. i am using an iFrame to pass a url string of files to upload to server. on the client i have created a multiple...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.