Please Help: HttpFileCollection is Always Zero.

  • Thread starter Thread starter pbd22
  • Start date Start date
P

pbd22

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/u...rator.FTP-SERVER\Desktop\maid\4088\ooTree.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(postedFile.FileName))

End If

Next iFile
 
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?
 
Back
Top