PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET please, please help - can't access HTTPFileCollection

Reply

please, please help - can't access HTTPFileCollection

 
Thread Tools Rate Thread
Old 13-12-2006, 02:01 PM   #1
pbd22
Guest
 
Posts: n/a
Default please, please help - can't access HTTPFileCollection


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%20and%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%5CDocuments%20and
%20Settings%5CAdministrator.FTP-SERVER%5CMy%20Documents%5CMy
%20Music%5CiTunes%5CiTunes%20Music%5CJarabe%20De%20Palo%5CL
a%20Flaca%5C04%20La%20Flaca.m4a&video_0=C%3A%5CDocuments%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(postedFile.FileName))

End If

Next iFile

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off