473,402 Members | 2,064 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,402 software developers and data experts.

Please Help: HttpFileCollection is Always Zero.

hi.

i am having probs accessing the HttpFileCollection.
the count/length is always zero. i have tried getting the url
of the current form, and it checks out... looks like this:

http://www.imperialistwebsite.com/up...8%5CooTree.htm

but, when i iterate though the httpfilecollection, i always get a
length = 0 and, hence, myfiles.Count = 0.

this is an upload using javascript (not the asp:fileupload tool)
from the referring page and through a hidden iframe - could that be
mucking things up?

help very much appreciated at this point. thanks.

'get the form file collection
Dim myfiles As System.Web.HttpFileCollection =
System.Web.HttpContext.Current.Request.Files
Dim iFile As Integer

For iFile = 0 To myfiles.Count - 1

'get the posted file
Dim postedFile As System.Web.HttpPostedFile =
myfiles(iFile)

'make sure it is not blank
If Not postedFile.FileName.Equals("") Then

Upload a file from your local hard disk to the FTP site.

ftpClient.UploadFile(System.IO.Path.GetFileName(po stedFile.FileName))

End If

Next iFile

Dec 12 '06 #1
1 4345

hi again.

is this question unusually hard or confusing? i am posting it all over
the interent
but nobody responds... i'd at least be interested in "why" i am not
getting a response
so i can adjust the question.

thanks?

pbd22 wrote:
hi.

i am having probs accessing the HttpFileCollection.
the count/length is always zero. i have tried getting the url
of the current form, and it checks out... looks like this:

http://www.imperialistwebsite.com/up...8%5CooTree.htm

but, when i iterate though the httpfilecollection, i always get a
length = 0 and, hence, myfiles.Count = 0.

this is an upload using javascript (not the asp:fileupload tool)
from the referring page and through a hidden iframe - could that be
mucking things up?

help very much appreciated at this point. thanks.

'get the form file collection
Dim myfiles As System.Web.HttpFileCollection =
System.Web.HttpContext.Current.Request.Files
Dim iFile As Integer

For iFile = 0 To myfiles.Count - 1

'get the posted file
Dim postedFile As System.Web.HttpPostedFile =
myfiles(iFile)

'make sure it is not blank
If Not postedFile.FileName.Equals("") Then

Upload a file from your local hard disk to the FTP site.

ftpClient.UploadFile(System.IO.Path.GetFileName(po stedFile.FileName))

End If

Next iFile
Dec 13 '06 #2

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

Similar topics

1
by: Eagle | last post by:
Hi All, I'm using the wonderful CURL lib to handle data between php-scripts in the background. However, I am experiencing a problem: Whenever the processed data is returned for output I see a...
7
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
7
by: david | last post by:
Hi, I have 2 text boxes on an ASP form. A user enters a Serial Number in TB1 such as 0105123456, presses tab to move to TB2, TB2 then displays the value of TB1 after a calculation has been...
7
by: Drew Berkemeyer | last post by:
I've encounted a pretty strange problem and I'm not quite sure what to make of it. I have a web service that consumes an XML file as well as a few other parameters. This web service works fine...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
13
by: sd00 | last post by:
Hi all, can someone give me some coding help with a problem that *should* be really simple, yet I'm struggling with. I need the difference between 2 times (Target / Actual) However, these times...
0
by: pbd22 | last post by:
hi. i am having probs accessing the HttpFileCollection. the count/length is always zero. the file upload parameters passed to the page that should be getting the httpfilecollection looks like...
1
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the...
0
by: Olorin | last post by:
Hi all. In one of our classes I defined a .Files property that exposes an instance of the HttpFileCollection class. At runtime this instance will be retrieved from...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.