473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

HTMLInputFile Issue

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-

Jun 23 '06 #1
3 1170
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-

re******@yahoo.com wrote:
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-


Jun 23 '06 #2
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]

<re******@yahoo.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
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-

Jun 24 '06 #3
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-

Ken Cox [Microsoft MVP] wrote:
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]

<re******@yahoo.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
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-


Jun 26 '06 #4

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

Similar topics

5
by: shimonsim | last post by:
Hi, I need to upload pictures from client machine and I am using HtmlInputFile control I set validator to make sure that file has correct expention but if one of the files has incorrect extention...
2
by: Augusto Cesar via DotNetMonster.com | last post by:
Hi, I want to customize the HtmlInputFile. I wanna something like an image button to play the "browse" button hole and hide the textbox. Is that possible? I also have tried to hide an...
7
by: Buddy Ackerman | last post by:
I created this class Public Class HTMLFileInput : Inherits System.Web.UI.HtmlControls.HtmlInputFile Public Property Data As String Get Return ViewState("HTMLFileInput.Data") End Get Set...
3
by: Dave Adler | last post by:
Is there any way to retain the value of an HtmlInputFile control through a postback? I do some server side validation on the page when it is submitted and if an error occurs on the page the...
7
by: cindy | last post by:
I have a System.Web.UI.HtmlControls.HtmlInputFile control that I use to submit files. Before the file is successfully submitted I validate another field on the form, it is the description of the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.