HTMLInputFile Issue

R

renor321

Hi,

I'm trying to use an HTMLInputFile control to upload files to a web
server. When I run this on my local computer (Windows XP, .Net 1.1),
it works just fine. When I deploy the app to my dev server (Windows
2003, .Net 1.1), however, I'm unable to get the control to work
properly. It seems that the file I'm trying to upload doesn't even get
posted, as the following code always returns TRUE:
"If ctlUploadFile.PostedFile Is Nothing"
I've looked all over the usual suspects-The HTML form has
encType="multipart/form-data", and it looks like IIS is allowing POST
on aspx pages.
Any assistance would be greatly appreciated.

Thanks!

-Dave-
 
D

Dave

I forgot to mention that the web.config file is also set to allow files
larger than 4 MB. Even so, the files I'm working with are less than 4
MB.

Thanks!

-Dave-
 
K

Ken Cox [Microsoft MVP]

Hi Dave,

You've probably checked, but are you sure the permissions allow the current
ASPNET account to write to the file system on the dev server?

Are you able to catch any error messages?

Ken
Microsoft MVP [ASP.NET]
 
D

Dave

Hi Ken,

Thanks for getting back to me.

I've given the ASPNET account read/write access to the specific
directory that it needs to write to. I've also given the Network
Service account the same rights, as I read somewhere that that account
might be used as well.

If I change the code to catch "ctlUploadFile.PostedFile.FileName", I
get an error message stating that the object reference is not set to an
instance of an object. It appears that the HTMLInput isn't picking up
the file at all. I'm completely stumped, as it works on my local
machine, but not on the Windows 2003 dev server.

Thanks!

-Dave-
Hi Dave,

You've probably checked, but are you sure the permissions allow the current
ASPNET account to write to the file system on the dev server?

Are you able to catch any error messages?

Ken
Microsoft MVP [ASP.NET]

Hi,

I'm trying to use an HTMLInputFile control to upload files to a web
server. When I run this on my local computer (Windows XP, .Net 1.1),
it works just fine. When I deploy the app to my dev server (Windows
2003, .Net 1.1), however, I'm unable to get the control to work
properly. It seems that the file I'm trying to upload doesn't even get
posted, as the following code always returns TRUE:
"If ctlUploadFile.PostedFile Is Nothing"
I've looked all over the usual suspects-The HTML form has
encType="multipart/form-data", and it looks like IIS is allowing POST
on aspx pages.
Any assistance would be greatly appreciated.

Thanks!

-Dave-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top