By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,625 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,625 IT Pros & Developers. It's quick & easy.

please, please help - can't access HTTPFileCollection

P: n/a
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 this.

uploadprogress.aspx?&video_2=C%3A%5CDocuments%20an d%20Settings%
5CAdministrator.FTP-SERVER%5CMy%20Documents%5CMy%20Music%5C
iTunes%5CiTunes%20Music%5CJarabe%20De%20Palo%5CLa% 20Flaca%5C
01%20Quiero%20Ser%20Poeta.m4a&video_1=C%3A%5CDocum ents%20and
%20Settings%5CAdministrator.FTP-SERVER%5CMy%20Documents%5CMy
%20Music%5CiTunes%5CiTunes%20Music%5CJarabe%20De%2 0Palo%5CL
a%20Flaca%5C04%20La%20Flaca.m4a&video_0=C%3A%5CDoc uments%20
and%20Settings%5CAdministrator.FTP-SERVER%5CMy%20Documents%5C
My%20Music%5CiTunes%5CiTunes%20Music%5CJarabe%20De %20Palo%5
CLa%20Flaca%5C11%20La%20Flaca%28Acustica%29.m4a

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
messing things up?

below is the server code that (is supposed to) iterate through the
httpfilecollection.

help "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 the FTP server.

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

End If

Next iFile

Dec 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.